Struct PostOrder

Source
pub struct PostOrder<O = OverData>
where O: Over,
{ /* private fields */ }
Expand description

A post order traverser (Wikipedia).

A traverser can be created once and used to traverse over trees multiple times without requiring additional memory allocation.

§Construction

A post order traverser can be created,

  • either by using Default trait and providing its two generic type parameters
    • PostOrder::<_, OverData>::default() or PostOrder::<_, OverDepthSiblingIdxData>::default(), or
    • PostOrder::<Dyn<u64>, OverData>::default() or PostOrder::<Dary<2, String>, OverDepthSiblingIdxData>::default() if we want the complete type signature.
  • or by using the Traversal type.
    • Traversal.post_order() or Traversal.post_order().with_depth().with_sibling_idx().

Trait Implementations§

Source§

impl Default for PostOrder

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<O> Traverser<O> for PostOrder<O>
where O: Over,

Source§

type IntoOver<O2> = PostOrder<O2> where O2: Over

Transformed version of the traverser from creating iterators over O to O2.
Source§

fn new() -> Self

Creates a new traverser.
Source§

fn transform_into<O2: Over>(self) -> Self::IntoOver<O2>

Consumes this traverser and returns a transformed version of it which creates iterators over O2 rather than O2.
Source§

fn over_data(self) -> Self::IntoOver<O::IntoOverData>

Returns the transformed version of the traverser where it yields: Read more
Source§

fn over_nodes(self) -> Self::IntoOver<O::IntoOverNode>

Returns the transformed version of the traverser where it yields: Read more
Source§

fn with_depth(self) -> Self::IntoOver<O::IntoWithDepth>

Returns the transformed version of the traverser where it yields: Read more
Source§

fn with_sibling_idx(self) -> Self::IntoOver<O::IntoWithSiblingIdx>

Returns the transformed version of the traverser where it yields: Read more

Auto Trait Implementations§

§

impl<O> Freeze for PostOrder<O>

§

impl<O> RefUnwindSafe for PostOrder<O>
where O: RefUnwindSafe,

§

impl<O> Send for PostOrder<O>
where O: Send,

§

impl<O> Sync for PostOrder<O>
where O: Sync,

§

impl<O> Unpin for PostOrder<O>
where O: Unpin,

§

impl<O> UnwindSafe for PostOrder<O>
where O: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> SoM<T> for T

Source§

fn get_ref(&self) -> &T

Returns a reference to self.
Source§

fn get_mut(&mut self) -> &mut T

Returns a mutable reference to self.
Source§

impl<T> SoR<T> for T

Source§

fn get_ref(&self) -> &T

Returns a reference to self.
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.