schroedinger_box 0.0.2

A Rust container type modeled after Erwin Schrödinger’s famous thought experiment.
Documentation
  • Coverage
  • 80%
    4 out of 5 items documented1 out of 4 items with examples
  • Size
  • Source code size: 24.6 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 2.1 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 19s Average build duration of successful builds.
  • all releases: 19s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • ftxqxd/schroedinger_box
    6 2 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • ftxqxd

SchroedingerBox

A box that contains many values, but collapses into one when opened (read from) for the first time.

Example

let cat_is_alive = SchroedingerBox::new(vec![true, false]);
// Here the cat is both dead and alive, but when we observe it...
let state = *cat_is_alive;
// ...it collapses into one of the possible states with equal probability.
assert_eq!(state, *cat_is_alive);

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.