Trait frunk::hlist::Selector[][src]

pub trait Selector<S, I> {
    pub fn get(&self) -> &S;
pub fn get_mut(&mut self) -> &mut S; }

Trait for borrowing an HList element by type

This trait is part of the implementation of the inherent method HCons::get. Please see that method for more information.

You only need to import this trait when working with generic HLists of unknown type. If you have an HList of known type, then list.get() should “just work” even without the trait.

Required methods

pub fn get(&self) -> &S[src]

Borrow an element by type from an HList.

Please see the inherent method for more information.

The only difference between that inherent method and this trait method is the location of the type parameters (here, they are on the trait rather than the method).

pub fn get_mut(&mut self) -> &mut S[src]

Mutably borrow an element by type from an HList.

Please see the inherent method for more information.

The only difference between that inherent method and this trait method is the location of the type parameters (here, they are on the trait rather than the method).

Loading content...

Implementors

impl<Head, Tail, FromTail, TailIndex> Selector<FromTail, There<TailIndex>> for HCons<Head, Tail> where
    Tail: Selector<FromTail, TailIndex>, 
[src]

impl<T, Tail> Selector<T, Here> for HCons<T, Tail>[src]

Loading content...