State management
Usage
Include state in your Cargo.toml [dependencies]:
[dependencies]
zoon = "0.1.6"
get
use State;
let state = new;
assert!;
assert_eq!;
assert!;
get_or_init
use State;
let state = new;
let value = state.get_or_init;
assert_eq!;
let value = state.get_or_init;
assert_eq!;
get_or_try_init
use State;
let state = new;
assert_eq!;
assert!;
let value = state.get_or_try_init;
assert_eq!;
assert_eq!
into_inner
use State;
let state: = new;
assert_eq!;
let state = new;
state.set.unwrap;
assert_eq!;
take
use State;
let mut state: = new;
assert_eq!;
let mut state = new;
state.set.unwrap;
assert_eq!;
assert_eq!;