pub fn from<U, F>(
        state: &U,
        mut func: F,
        reader: fn(&T) -> D,
        writer: fn(&T, D),
        new: fn(D) -> T,
    ) -> Self
    where
        U: StateTrait + 'static,
        F: FnMut(U::Value) -> <Self as StateTrait>::Value + 'static,
    {
        let value = func(state.value());
        let new = Self::new(value, reader, writer, new);

        super::from(new, state, func)
    }
/// A from function to derive the value from other state variables.
A from function to derive the value from other state variables.
A from function to derive the value from other state variables .
pub fn from<U, F>(
        state: &U,
        mut func: F,
        reader: fn(&T) -> D,
        writer: fn(&T, D),
        new: fn(D) -> T,
    ) -> Self
    where
        U: StateTrait + 'static,
        F: FnMut(U::Value) -> <Self as StateTrait>::Value + 'static,
    {
        let value = func(state.value());
        let new = Self::new(value, reader, writer, new);
        super::from(new, state, func)
    }
pub fn from < U , F > ( state : & U , mut func : F , reader : fn ( & T ) -> D , writer : fn ( & T , D ) , new : fn ( D ) -> T , ) -> Self where U : StateTrait + ' static , F : FnMut ( U :: Value ) -> < Self as StateTrait > :: Value + ' static , { let value = func ( state . value ( ) ) ; let new = Self :: new ( value , reader , writer , new ) ; super :: from ( new , state , func ) }
A from function to derive the value from other state variables.
A from function to derive the value from other state variables .
state
&U
func
F
reader
fn(&T) -> D
writer
fn(&T, D)
new
fn(D) -> T