[][src]Function moxie::cache_state

pub fn cache_state<Arg: ?Sized, Input, Output>(
    arg: &Arg,
    init: impl FnOnce(&Input) -> Output
) -> (Commit<Output>, Key<Output>) where
    Arg: PartialEq<Input> + ToOwned<Owned = Input>,
    Input: Borrow<Arg> + 'static,
    Output: 'static, 

Root a state variable at this callsite, returning a Key to the state variable. Re-initializes the state variable if the capture arg changes.

Environment Expectations

This function requires the following types to be visible to illicit::get and will panic otherwise: