{"id":16482233,"url":"https://github.com/cobbinma/r-cache","last_synced_at":"2025-07-05T19:10:26.815Z","repository":{"id":45451412,"uuid":"296934024","full_name":"cobbinma/r-cache","owner":"cobbinma","description":"r-cache is an in memory key value store. It is thread safe and values can have expiry times.","archived":false,"fork":false,"pushed_at":"2023-02-18T10:58:47.000Z","size":39,"stargazers_count":21,"open_issues_count":0,"forks_count":4,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-27T12:14:19.762Z","etag":null,"topics":["cache","caching","library","rust"],"latest_commit_sha":null,"homepage":"https://crates.io/crates/r-cache","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cobbinma.png","metadata":{"files":{"readme":"Readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-09-19T19:04:40.000Z","updated_at":"2023-05-02T17:31:09.000Z","dependencies_parsed_at":"2023-01-23T07:46:00.747Z","dependency_job_id":null,"html_url":"https://github.com/cobbinma/r-cache","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cobbinma%2Fr-cache","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cobbinma%2Fr-cache/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cobbinma%2Fr-cache/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cobbinma%2Fr-cache/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cobbinma","download_url":"https://codeload.github.com/cobbinma/r-cache/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243826783,"owners_count":20354220,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cache","caching","library","rust"],"created_at":"2024-10-11T13:10:05.552Z","updated_at":"2025-03-16T18:31:39.450Z","avatar_url":"https://github.com/cobbinma.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003er-cache\u003c/h1\u003e\n\u003cdiv align=\"center\"\u003e\n \u003cstrong\u003e\n   A simple caching library\n \u003c/strong\u003e\n\u003c/div\u003e\n\n\u003cbr /\u003e\n\n\u003cdiv align=\"center\"\u003e\n  \u003c!-- Crates version --\u003e\n  \u003ca href=\"https://crates.io/crates/r-cache\"\u003e\n    \u003cimg src=\"https://img.shields.io/crates/v/r-cache.svg?style=flat-square\"\n    alt=\"Crates.io version\" /\u003e\n  \u003c/a\u003e\n  \u003c!-- Downloads --\u003e\n  \u003ca href=\"https://crates.io/crates/r-cache\"\u003e\n    \u003cimg src=\"https://img.shields.io/crates/d/r-cache.svg?style=flat-square\"\n      alt=\"Download\" /\u003e\n  \u003c/a\u003e\n  \u003c!-- docs.rs docs --\u003e\n  \u003ca href=\"https://docs.rs/r-cache\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/docs-latest-blue.svg?style=flat-square\"\n      alt=\"docs.rs docs\" /\u003e\n  \u003c/a\u003e\n\u003c/div\u003e\n\n\u003cbr\u003e\n\nr-cache is an in memory key value store. It is thread safe and values can have expiry times.\n\n### Example\n\n```rust\nuse async_std::sync::Arc;\nuse async_std::task;\nuse r_cache::cache::Cache;\nuse std::time::Duration;\n\nconst KEY: i8 = 0;\nconst VALUE: \u0026str = \"VALUE\";\n\n#[async_std::main]\nasync fn main() {\n    let cache = Arc::new(Cache::new(Some(Duration::from_secs(5 * 60))));\n    task::spawn({\n        let cache = Arc::clone(\u0026cache);\n        async move {\n            loop {\n                task::sleep(Duration::from_secs(10 * 60)).await;\n                cache.remove_expired();\n            }\n        }\n    });\n\n    cache.set(KEY, VALUE, None);\n\n    assert_eq!(VALUE, cache.get(\u0026KEY).unwrap())\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcobbinma%2Fr-cache","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcobbinma%2Fr-cache","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcobbinma%2Fr-cache/lists"}