Trait erupt::ExtendableFrom[][src]

pub trait ExtendableFrom<'a, T> {
    fn extend_from(self, addition: &'a mut T) -> Self
    where
        Self: Sized
, { ... } }
Expand description

Provides type-safe pointer chain support.

Provided methods

Inserts addition (+ its pointer chain) between the head and tail of this pointer chain.

  • Head of self
    • Head of addition
    • Tail of addition
    • Tail of addition
    • Tail of addition
  • Tail of self
  • Tail of self
  • Tail of self

The implementation is like this specifically, because this trait is only ever implemented on the “main carrier” of the pointer chain, which means that addition doesn’t usually have a “tail” (unless, you’ve set the pointers by yourself, which this consequently also supports). This saves us from iterating the entire pointer chain each time an item is added.

Implementors