{"id":16184047,"url":"https://github.com/fralonra/aict","last_synced_at":"2025-10-29T23:35:01.451Z","repository":{"id":216745241,"uuid":"696677151","full_name":"fralonra/aict","owner":"fralonra","description":"Generaties auto-incrementing unique IDs","archived":false,"fork":false,"pushed_at":"2023-10-11T10:47:49.000Z","size":7,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-28T17:17:08.060Z","etag":null,"topics":["autoincrement","id","id-generation"],"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/fralonra.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,"governance":null,"roadmap":null,"authors":null}},"created_at":"2023-09-26T08:18:13.000Z","updated_at":"2023-09-26T08:19:33.000Z","dependencies_parsed_at":"2024-01-12T14:15:02.724Z","dependency_job_id":"e05cdd90-eae0-4da6-9ecb-5d8d849a4845","html_url":"https://github.com/fralonra/aict","commit_stats":null,"previous_names":["fralonra/aict"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fralonra%2Faict","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fralonra%2Faict/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fralonra%2Faict/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fralonra%2Faict/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fralonra","download_url":"https://codeload.github.com/fralonra/aict/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247655547,"owners_count":20974196,"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":["autoincrement","id","id-generation"],"created_at":"2024-10-10T07:08:49.913Z","updated_at":"2025-10-29T23:34:56.416Z","avatar_url":"https://github.com/fralonra.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# aict\n\n[![Latest version](https://img.shields.io/crates/v/aict.svg)](https://crates.io/crates/aict)\n[![Documentation](https://docs.rs/aict/badge.svg)](https://docs.rs/aict)\n![MIT](https://img.shields.io/badge/license-MIT-blue.svg)\n\n`aict` is designed for generating auto-incrementing unique IDs of a specific type.\n\nIt provides built-in support for integer types (`i8`, `i16`, `i32`, `i64`, `isize`, `u8`, `u16`, `u32`, `u64`, `usize`). However, you can add support for your own types by implementing the [`Aictable`](https://docs.rs/aict/latest/aict/struct.Aictable.html) trait.\n\n## Examples\n\n```rust\nuse aict::Factory;\n\n// Creates a new Factory for u32 IDs.\nlet mut factory = Factory::\u003cu32\u003e::builder()\n    // Sets the initial value for the IDs.\n    // For built-in types, the default value is the minimum value.\n    // .initial_value(1)\n\n    // Whether to loop back to the initial value after reaching the maximum value.\n    // Default is false.\n    // .looping(true)\n\n    // Whether to rewind to the position of the latest removed ID when generating the next ID.\n    // Default is false.\n    // .rewind(true)\n\n    .build();\n\n// Generates some IDs.\nassert_eq!(factory.next().unwrap(), 0);\nassert_eq!(factory.next().unwrap(), 1);\n\n// Removes an ID so that it can be reused in the future.\nfactory.remove(0);\n\n// Manually marks an ID as used.\nassert!(factory.take_up(2).is_ok());\n// Since 2 was taken up, the next available ID is 3.\n// However, if rewind is set to true, the next ID is 0.\nassert_eq!(factory.next().unwrap(), 3);\n```\n\n## Similiar Crates\n\n- [serial_int](https://crates.io/crates/serial_int)\n- [autoincrement](https://crates.io/crates/autoincrement)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffralonra%2Faict","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffralonra%2Faict","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffralonra%2Faict/lists"}