Trait erupt::ExtendableFrom
source · 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
sourcefn extend_from(self, addition: &'a mut T) -> Selfwhere
Self: Sized,
fn extend_from(self, addition: &'a mut T) -> Selfwhere
Self: Sized,
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
- …
- Head of
- 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.