{"id":19454020,"url":"https://github.com/vurv78/mincache","last_synced_at":"2025-02-25T10:21:37.919Z","repository":{"id":62444306,"uuid":"484903024","full_name":"Vurv78/mincache","owner":"Vurv78","description":"Minimal crate to cache return values of your function returns.","archived":false,"fork":false,"pushed_at":"2022-04-24T02:24:18.000Z","size":5,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-08T02:35:41.949Z","etag":null,"topics":["cache","function","memoize","minimal","rust"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Vurv78.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-04-24T02:17:29.000Z","updated_at":"2022-04-24T02:26:00.000Z","dependencies_parsed_at":"2022-11-01T22:30:34.692Z","dependency_job_id":null,"html_url":"https://github.com/Vurv78/mincache","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/Vurv78%2Fmincache","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Vurv78%2Fmincache/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Vurv78%2Fmincache/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Vurv78%2Fmincache/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Vurv78","download_url":"https://codeload.github.com/Vurv78/mincache/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240645843,"owners_count":19834493,"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","function","memoize","minimal","rust"],"created_at":"2024-11-10T17:07:11.072Z","updated_at":"2025-02-25T10:21:37.876Z","avatar_url":"https://github.com/Vurv78.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ``mincache``\nMinimal crate to cache return values of your function returns.\n\nCurrently only supports a timer / cooldown cache.\n\n## Example\n```rs\npub use mincache::timed;\n\n// \"fmt\" is what you'd put after core::time::Duration::from_\u003c\u003e. E.g. \"secs\", \"millis\", \"nanos\", etc.\n#[timed(t = 5000, fmt = \"millis\"/*, reference = true*/)]\npub fn func(x: i32) -\u003e std::time::Instant {\n\tprintln!(\"This will print once {x}\");\n\n\t// Reference non-cached self.\n\t// inner_func(x);\n\n\t// This value will be cloned each time this is called before the cooldown is over\n\t// If you want to instead pass a reference, look into mincache/tests/ref.rs\n\t// (just add ``reference = true`` to the attribute params)\n\tstd::time::Instant::now()\n}\n\nfn main() {\n\t// Will call the function a single time.\n\tfor _ in 0..1000000 {\n\t\tlet _xyz = func(55);\n\t}\n}\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvurv78%2Fmincache","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvurv78%2Fmincache","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvurv78%2Fmincache/lists"}