pub struct ElementChain { /* private fields */ }Expand description
右(自分)→ 左(祖先)
Cloning is O(1) and prepending an element is O(1): descendant chains share
their ancestor links through Arc.
Implementations§
Source§impl ElementChain
impl ElementChain
Sourcepub fn prepend(&self, info: Option<ElementInfo>) -> Self
pub fn prepend(&self, info: Option<ElementInfo>) -> Self
Returns this chain extended with info as the innermost element.
Passing None yields an equivalent chain without allocating.
Sourcepub fn first(&self) -> Option<&ElementInfo>
pub fn first(&self) -> Option<&ElementInfo>
The innermost (current) element.
Sourcepub fn from_vec(elements: Vec<ElementInfo>) -> Self
pub fn from_vec(elements: Vec<ElementInfo>) -> Self
Builds a chain from elements ordered innermost-first.
Sourcepub fn from_document_order(
elements: impl IntoIterator<Item = ElementInfo>,
) -> Self
pub fn from_document_order( elements: impl IntoIterator<Item = ElementInfo>, ) -> Self
Builds a chain by prepending elements in iteration order, so the
last element becomes the nearest link. Feeding siblings in document
order therefore yields a nearest-first chain.
Trait Implementations§
Source§impl Clone for ElementChain
impl Clone for ElementChain
Source§fn clone(&self) -> ElementChain
fn clone(&self) -> ElementChain
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ElementChain
impl Debug for ElementChain
Source§impl Default for ElementChain
impl Default for ElementChain
Source§fn default() -> ElementChain
fn default() -> ElementChain
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ElementChain
impl RefUnwindSafe for ElementChain
impl Send for ElementChain
impl Sync for ElementChain
impl Unpin for ElementChain
impl UnsafeUnpin for ElementChain
impl UnwindSafe for ElementChain
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<S, T> Duplex<S> for Twhere
T: FromSample<S> + ToSample<S>,
§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
impl<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
fn into_sample(self) -> T
§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
Read this value from the supplied reader. Same as
ReadEndian::read_from_little_endian().