Skip to main content

KpTrait

Trait KpTrait 

Source
pub trait KpTrait<R, V, Root, Value, MutRoot, MutValue, G, S> {
    // Required methods
    fn get(&self, root: Root) -> Option<Value>;
    fn get_mut(&self, root: MutRoot) -> Option<MutValue>;
    fn then<SV, SubValue, MutSubValue, G2, S2>(
        self,
        next: Kp<V, SV, Value, SubValue, MutValue, MutSubValue, G2, S2>,
    ) -> Kp<R, SV, Root, SubValue, MutRoot, MutSubValue, impl Fn(Root) -> Option<SubValue>, impl Fn(MutRoot) -> Option<MutSubValue>>
       where Self: Sized,
             Root: Borrow<R>,
             Value: Borrow<V>,
             MutRoot: BorrowMut<R>,
             MutValue: BorrowMut<V>,
             SubValue: Borrow<SV>,
             MutSubValue: BorrowMut<SV>,
             G2: Fn(Value) -> Option<SubValue>,
             S2: Fn(MutValue) -> Option<MutSubValue>,
             V: 'static;

    // Provided methods
    fn type_id_of_root() -> TypeId
       where R: 'static { ... }
    fn type_id_of_value() -> TypeId
       where V: 'static { ... }
}

Required Methods§

Source

fn get(&self, root: Root) -> Option<Value>

Source

fn get_mut(&self, root: MutRoot) -> Option<MutValue>

Source

fn then<SV, SubValue, MutSubValue, G2, S2>( self, next: Kp<V, SV, Value, SubValue, MutValue, MutSubValue, G2, S2>, ) -> Kp<R, SV, Root, SubValue, MutRoot, MutSubValue, impl Fn(Root) -> Option<SubValue>, impl Fn(MutRoot) -> Option<MutSubValue>>
where Self: Sized, Root: Borrow<R>, Value: Borrow<V>, MutRoot: BorrowMut<R>, MutValue: BorrowMut<V>, SubValue: Borrow<SV>, MutSubValue: BorrowMut<SV>, G2: Fn(Value) -> Option<SubValue>, S2: Fn(MutValue) -> Option<MutSubValue>, V: 'static,

Provided Methods§

Source

fn type_id_of_root() -> TypeId
where R: 'static,

Source

fn type_id_of_value() -> TypeId
where V: 'static,

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<R, V, Root, Value, MutRoot, MutValue, G, S> KpTrait<R, V, Root, Value, MutRoot, MutValue, G, S> for Kp<R, V, Root, Value, MutRoot, MutValue, G, S>
where Root: Borrow<R>, Value: Borrow<V>, MutRoot: BorrowMut<R>, MutValue: BorrowMut<V>, G: Fn(Root) -> Option<Value>, S: Fn(MutRoot) -> Option<MutValue>,