atomic-slot 0.1.0

A simple, lock-free, atomic slot for transferring ownership of Box<T>
Documentation
  • Coverage
  • 100%
    13 out of 13 items documented12 out of 13 items with examples
  • Size
  • Source code size: 24.9 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.47 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 15s Average build duration of successful builds.
  • all releases: 15s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • TroyNeubauer/atomic-slot
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • TroyNeubauer

atomic-slot

A simple, lock-free, atomic slot for transferring ownership of Box<T>.

The AtomicSlot<T> holds at most one Box<T> and allows you to swap, take or store an optional value using only atomic operations.

Examples

use atomic_slot::AtomicSlot;
use std::sync::atomic::Ordering;

let slot = AtomicSlot::new(Box::new(7));
assert_eq!(*slot.take().unwrap(), 7);
assert!(slot.is_none());