init_state!() { /* proc-macro */ }
Expand description

Returns the value for the specified key, if it exists. If it does not exist, the key is created and set to the specified default_value, and then the default_value is returned.

Example

write_state!("my key", "A");
init_state!("my key", "B"); // => "A"
init_state!("other key", "B"); // => "B"