#once #cell #singleton #exclusive #static #synchronization-primitive

no-std exclusive_cell

A thread-safe, non-blocking, no-std cell that can only be accessed once

1 unstable release

0.1.0 Dec 15, 2022

#2964 in Rust patterns

Download history 686/week @ 2024-07-23 763/week @ 2024-07-30 547/week @ 2024-08-06 394/week @ 2024-08-13 774/week @ 2024-08-20 903/week @ 2024-08-27 539/week @ 2024-09-03 667/week @ 2024-09-10 381/week @ 2024-09-17 512/week @ 2024-09-24 658/week @ 2024-10-01 531/week @ 2024-10-08 383/week @ 2024-10-15 474/week @ 2024-10-22 279/week @ 2024-10-29 442/week @ 2024-11-05

1,634 downloads per month
Used in 2 crates (via hermit-sync)

MIT/Apache

11KB
84 lines

exclusive_cell

Crates.io docs.rs CI

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 sucessfully.

For API documentation see the docs.

License

Licensed under either of

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.

No runtime deps