Chain

Trait Chain 

Source
pub trait Chain<I: Index>: Seal<I> {
    type Element;

    // Required methods
    fn get(&self) -> &Self::Element;
    fn get_mut(&mut self) -> &mut Self::Element;
}
Expand description

A trait for accessing elements in a type-level list.

§Type Parameters

  • I: The index of the element in the list, which must implement the Index trait.

This trait is sealed and cannot be implemented outside of this crate.

Required Associated Types§

Source

type Element

The type of the element at the specified index.

Required Methods§

Source

fn get(&self) -> &Self::Element

Retrieves an immutable reference to the element at the specified index.

§Returns

A reference to the element of type Self::Element.

Source

fn get_mut(&mut self) -> &mut Self::Element

Retrieves a mutable reference to the element at the specified index.

§Returns

A mutable reference to the element of type Self::Element.

Implementors§

Source§

impl<Head, Tail, HeadIndex> Chain<InHead<HeadIndex>> for Node<Head, Tail>
where HeadIndex: Index, Head: Chain<HeadIndex>,

Source§

type Element = <Head as Chain<HeadIndex>>::Element

Source§

impl<Head, Tail, TailIndex> Chain<InTail<TailIndex>> for Node<Head, Tail>
where TailIndex: Index, Tail: Chain<TailIndex>,

Source§

type Element = <Tail as Chain<TailIndex>>::Element

Source§

impl<T> Chain<Here> for T