zucchero 1.0.0

Minimal macro for globally shared, type-safe singleton
Documentation
  • Coverage
  • 50%
    2 out of 4 items documented0 out of 1 items with examples
  • Size
  • Source code size: 4.8 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 246.64 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 14s Average build duration of successful builds.
  • all releases: 14s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • sergey-melnychuk/zucchero
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • sergey-melnychuk

zucchero

Minimal macro for globally shared, type-safe singleton.


[dependencies]
zucchero = "1"

#[derive(Clone, Default, Debug)]
struct State {
    answer: usize,
}

zucchero::init!(State, expose);

fn main() {
    expose(|state| state.answer = 42);

    let state = expose(|state| state.clone());
    println!("{state:?}");
}