{"id":15383296,"url":"https://github.com/neolegends/memselect","last_synced_at":"2025-07-18T18:33:00.244Z","repository":{"id":57637942,"uuid":"137576668","full_name":"NeoLegends/memselect","owner":"NeoLegends","description":"No-std compatible memoizing selectors for Rust","archived":false,"fork":false,"pushed_at":"2018-07-23T08:10:18.000Z","size":7,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-01T10:54:39.568Z","etag":null,"topics":["compose","memoization","selector"],"latest_commit_sha":null,"homepage":null,"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/NeoLegends.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-06-16T11:47:33.000Z","updated_at":"2019-06-12T14:44:37.000Z","dependencies_parsed_at":"2022-09-26T20:21:03.760Z","dependency_job_id":null,"html_url":"https://github.com/NeoLegends/memselect","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NeoLegends%2Fmemselect","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NeoLegends%2Fmemselect/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NeoLegends%2Fmemselect/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NeoLegends%2Fmemselect/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/NeoLegends","download_url":"https://codeload.github.com/NeoLegends/memselect/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248033424,"owners_count":21036789,"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":["compose","memoization","selector"],"created_at":"2024-10-01T14:36:48.855Z","updated_at":"2025-04-09T11:44:03.947Z","avatar_url":"https://github.com/NeoLegends.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# memselect\n\n![Travis](https://img.shields.io/travis/NeoLegends/memselect.svg)\n\nNo-std compatible memoizing selectors for Rust.\n\nMemselect allows you to create efficient selectors for memoizing expensive computations. The selectors can be composed to create higher-level selectors that benefit from memoization all the way down. Monomorphization ensures efficient runtime behavior.\n\n## Example\n```rust\nuse memselect::{new1, new2, Selector2};\n\nlet mut computations = 0;\n\n{\n    let base = new1(|num: u32| num, |num| num * 2);\n\n    let mut selector = new2(\n        base, // You can nest selectors\n        |num: u32| num * 3,\n        |num1, num2| { // This function gets the output of `base` and the fn above\n            computations += 1;\n            (*num1, *num2)\n        },\n    );\n\n    assert_eq!(selector.select(2, 3), (4, 9));\n    assert_eq!(selector.select(2, 3), (4, 9));\n}\n\n// Value was computed only once\nassert_eq!(computations, 1);\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fneolegends%2Fmemselect","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fneolegends%2Fmemselect","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fneolegends%2Fmemselect/lists"}