Skip to main content

KpValue

Type Alias KpValue 

Source
pub type KpValue<'a, R, V> = Kp<R, V, &'a R, V, &'a mut R, V, for<'b> fn(&'b R) -> Option<V>, for<'b> fn(&'b mut R) -> Option<V>>;
Expand description

Kp will force dev to create get and set while value will be owned

Aliased Type§

pub struct KpValue<'a, R, V> {
    pub get: for<'b> fn(&'b R) -> Option<V>,
    pub set: for<'b> fn(&'b mut R) -> Option<V>,
    /* private fields */
}

Fields§

§get: for<'b> fn(&'b R) -> Option<V>

Getter closure: used by Kp::get for read-only access.

§set: for<'b> fn(&'b mut R) -> Option<V>

Setter closure: used by Kp::get_mut for mutation.