{"id":22941086,"url":"https://github.com/adamsky/id-pool","last_synced_at":"2025-08-12T21:31:36.638Z","repository":{"id":43262804,"uuid":"281192327","full_name":"adamsky/id-pool","owner":"adamsky","description":"Create and recycle integer ids using a ranged pool","archived":false,"fork":false,"pushed_at":"2022-07-06T20:15:56.000Z","size":14,"stargazers_count":5,"open_issues_count":1,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-01T11:11:22.378Z","etag":null,"topics":["id","integer","pool","range"],"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/adamsky.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":"2020-07-20T18:11:49.000Z","updated_at":"2025-01-15T10:00:19.000Z","dependencies_parsed_at":"2022-09-11T22:02:30.749Z","dependency_job_id":null,"html_url":"https://github.com/adamsky/id-pool","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/adamsky/id-pool","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adamsky%2Fid-pool","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adamsky%2Fid-pool/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adamsky%2Fid-pool/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adamsky%2Fid-pool/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/adamsky","download_url":"https://codeload.github.com/adamsky/id-pool/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adamsky%2Fid-pool/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270140406,"owners_count":24534393,"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","status":"online","status_checked_at":"2025-08-12T02:00:09.011Z","response_time":80,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["id","integer","pool","range"],"created_at":"2024-12-14T13:36:35.965Z","updated_at":"2025-08-12T21:31:36.320Z","avatar_url":"https://github.com/adamsky.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# id-pool\n\nCreate and recycle integer ids using a ranged pool.\n\n```rust\n// create a new id pool with an available range\nlet mut pool = IdPool::new_ranged(1..10);\n// request ids from the pool\nlet id1 = pool.request_id()); // 1\nlet id2 = pool.request_id()); // 2\nlet id3 = pool.request_id()); // 3\n// return arbitrary id back into the pool\npool.return_id(2)?;\n// recycle the returned id during subsequent request\nlet id4 = pool.request_id()); // 2\nlet id5 = pool.request_id()); // 4\n```\n\nThis crate is fairly minimalistic and so currently only\ndeals with single type of numerical ids. These can be\neither `usize` (default), `u64`, `u32` or `u16`, chosen\nwith the use of appropriate crate feature.\n\nThe main exported structure `IdPool` can be\ninitialized with a custom range and then queried for\nnew ids that are contained within that range. During\nthe course of the program, ids can be returned to the\npool to be reused for subsequent id request calls.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadamsky%2Fid-pool","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fadamsky%2Fid-pool","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadamsky%2Fid-pool/lists"}