atomic-destroy 0.1.0

An value which can be atomically read and destroyed; like an atomic Option.
Documentation
  • Coverage
  • 100%
    10 out of 10 items documented1 out of 10 items with examples
  • Size
  • Source code size: 9.52 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.19 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 8s Average build duration of successful builds.
  • all releases: 8s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Kestrer/atomic-destroy
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • Kestrer

Atomic Destroy

This crate provides a type which can hold a value and can be atomically destroyed; like an atomic Option.

It does not require the standard library.

Examples

use atomic_destroy::AtomicDestroy;

let value = AtomicDestroy::new(Box::new(5));
assert_eq!(**value.get().unwrap(), 5);
value.destroy();
// The Box's destructor is run here.
assert!(value.get().is_none());