{"id":15806245,"url":"https://github.com/qnighy/option-cell","last_synced_at":"2025-04-21T08:31:27.224Z","repository":{"id":193803623,"uuid":"689539673","full_name":"qnighy/option-cell","owner":"qnighy","description":"OptionCell: OnceCell but derivable from Option","archived":false,"fork":false,"pushed_at":"2023-09-10T06:12:41.000Z","size":5,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-10-06T02:42:38.901Z","etag":null,"topics":["rust","rust-patterns","unification","unification-algorithm"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/qnighy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE-Apache-2.0","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-09-10T06:05:37.000Z","updated_at":"2024-06-14T21:31:32.000Z","dependencies_parsed_at":null,"dependency_job_id":"5fe1ba70-201c-4ab3-b16d-96679740aef9","html_url":"https://github.com/qnighy/option-cell","commit_stats":null,"previous_names":["qnighy/option-cell"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qnighy%2Foption-cell","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qnighy%2Foption-cell/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qnighy%2Foption-cell/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qnighy%2Foption-cell/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/qnighy","download_url":"https://codeload.github.com/qnighy/option-cell/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248312133,"owners_count":21082638,"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":["rust","rust-patterns","unification","unification-algorithm"],"created_at":"2024-10-05T02:42:45.209Z","updated_at":"2025-04-21T08:31:26.966Z","avatar_url":"https://github.com/qnighy.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"## OptionCell: OnceCell but derivable from Option\n\nThis library provides an equivalent of [OnceCell](https://doc.rust-lang.org/stable/std/cell/struct.OnceCell.html), but it guarantees layout compatibility with `Option\u003cT\u003e`, providing additional transmute helpers.\n\n## Known use-cases\n\n- Implementing the [unification algorithm](https://en.wikipedia.org/wiki/Unification_(computer_science)) without exposing the interior mutability to the user or unnecessarily cloning the value.\n\n## Usage\n\n```txt\ncargo add option-cell\n```\n\n```rust\nuse option_cell::OptionCell;\n\nlet mut options = vec![None, None];\nlet cells = OptionCell::from_mut_slice(\u0026mut options);\ncells[0].set(1).unwrap();\n```\n\n## Development\n\nCheck with MIRI:\n\n```\ncargo +nightly miri test\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fqnighy%2Foption-cell","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fqnighy%2Foption-cell","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fqnighy%2Foption-cell/lists"}