pub enum DftEvent<T> {
Open(T),
Close(T),
}
Expand description
Event for depth first traversal.
Variants
Open(T)
Opening of a range.
For forward iteration, this event will be emitted when entering a node.
Close(T)
Closing of a range.
For forward iteration, this event will be emitted when leaving a node.
Implementations
sourceimpl<T> DftEvent<T>
impl<T> DftEvent<T>
sourcepub fn into_value(self) -> T
pub fn into_value(self) -> T
Returns the value with ownership.
sourcepub fn as_value_mut(&mut self) -> &mut T
pub fn as_value_mut(&mut self) -> &mut T
Returns a mutable reference to the value.
sourcepub fn map<F, U>(self, f: F) -> DftEvent<U> where
F: FnOnce(T) -> U,
pub fn map<F, U>(self, f: F) -> DftEvent<U> where
F: FnOnce(T) -> U,
Converts the internal value.
sourcepub fn into_close(self) -> Option<T>
pub fn into_close(self) -> Option<T>
Extracts the value for Close
event if possible.
sourceimpl<T> DftEvent<FrozenNode<T>>
impl<T> DftEvent<FrozenNode<T>>
Trait Implementations
sourceimpl<T: Clone> FromIterator<DftEvent<Node<T>>> for Result<Node<T>, TreeBuildError>
impl<T: Clone> FromIterator<DftEvent<Node<T>>> for Result<Node<T>, TreeBuildError>
sourceimpl<T: Ord> Ord for DftEvent<T>
impl<T: Ord> Ord for DftEvent<T>
sourceimpl<T: PartialOrd> PartialOrd<DftEvent<T>> for DftEvent<T>
impl<T: PartialOrd> PartialOrd<DftEvent<T>> for DftEvent<T>
sourcefn partial_cmp(&self, other: &DftEvent<T>) -> Option<Ordering>
fn partial_cmp(&self, other: &DftEvent<T>) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
sourceimpl<T: Clone> TryFrom<DftEvent<FrozenNode<T>>> for Event<T>
impl<T: Clone> TryFrom<DftEvent<FrozenNode<T>>> for Event<T>
type Error = BorrowError
type Error = BorrowError
The type returned in the event of a conversion error.
impl<T: Copy> Copy for DftEvent<T>
impl<T: Eq> Eq for DftEvent<T>
impl<T> StructuralEq for DftEvent<T>
impl<T> StructuralPartialEq for DftEvent<T>
Auto Trait Implementations
impl<T> RefUnwindSafe for DftEvent<T> where
T: RefUnwindSafe,
impl<T> Send for DftEvent<T> where
T: Send,
impl<T> Sync for DftEvent<T> where
T: Sync,
impl<T> Unpin for DftEvent<T> where
T: Unpin,
impl<T> UnwindSafe for DftEvent<T> where
T: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more