https://github.com/mkroening/exclusive_cell
A thread-safe, non-blocking, no-std cell that can only be accessed once.
https://github.com/mkroening/exclusive_cell
cell exclusive once rust singleton static
Last synced: 6 months ago
JSON representation
A thread-safe, non-blocking, no-std cell that can only be accessed once.
- Host: GitHub
- URL: https://github.com/mkroening/exclusive_cell
- Owner: mkroening
- License: apache-2.0
- Created: 2022-12-15T10:02:13.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2023-09-04T19:29:50.000Z (about 2 years ago)
- Last Synced: 2025-04-14T20:15:54.980Z (6 months ago)
- Topics: cell, exclusive, once, rust, singleton, static
- Language: Rust
- Homepage:
- Size: 11.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE-APACHE
Awesome Lists containing this project
README
# exclusive_cell
[](https://crates.io/crates/exclusive_cell)
[](https://docs.rs/exclusive_cell)
[](https://github.com/mkroening/exclusive_cell/actions/workflows/ci.yml)This crate provides two thread-safe, non-blocking, no-std synchronization primitives:
* [`ExclusiveCell`] can be accessed at most once and provides mutable access to the stored contents.
* [`CallOnce`] can only be called once successfully.[`ExclusiveCell`]: https://docs.rs/exclusive_cell/latest/exclusive_cell/struct.ExclusiveCell.html
[`CallOnce`]: https://docs.rs/exclusive_cell/latest/exclusive_cell/struct.CallOnce.htmlFor API documentation see the [docs].
[docs]: https://docs.rs/exclusive_cell
## License
Licensed under either of
* Apache License, Version 2.0
([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0)
* MIT license
([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT)at your option.
### Contribution
Unless you explicitly state otherwise, any contribution intentionally submitted
for inclusion in the work by you, as defined in the Apache-2.0 license, shall be
dual licensed as above, without any additional terms or conditions.