Trait ChainElement

Source
pub trait ChainElement: Sealed {
    type Inner;
    type Parent;

    // Required methods
    fn len(&self) -> usize;
    fn get(&self) -> &Self::Inner;
    fn get_mut(&mut self) -> &mut Self::Inner;
    fn pop(self) -> (Self::Inner, Self::Parent);

    // Provided method
    fn append<T>(self, item: T) -> Link<T, Self>
       where Self: Sized { ... }
}
Expand description

A generic chain element

Required Associated Types§

Required Methods§

Source

fn len(&self) -> usize

Return the number of objects linked to this chain element

Source

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

Source

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

Source

fn pop(self) -> (Self::Inner, Self::Parent)

Provided Methods§

Source

fn append<T>(self, item: T) -> Link<T, Self>
where Self: Sized,

Append an object to the chain

Implementors§

Source§

impl<V> ChainElement for Chain<V>

Source§

impl<V, VC> ChainElement for Link<V, VC>
where VC: ChainElement,

Source§

type Inner = V

Source§

type Parent = VC