#once #cell #exclusive #static #singleton #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

#2972 in Rust patterns

Download history 386/week @ 2023-12-12 296/week @ 2023-12-19 18/week @ 2023-12-26 276/week @ 2024-01-02 461/week @ 2024-01-09 463/week @ 2024-01-16 524/week @ 2024-01-23 535/week @ 2024-01-30 1031/week @ 2024-02-06 988/week @ 2024-02-13 641/week @ 2024-02-20 839/week @ 2024-02-27 502/week @ 2024-03-05 692/week @ 2024-03-12 573/week @ 2024-03-19 595/week @ 2024-03-26

2,537 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