Struct Recipe

Source
pub struct Recipe { /* private fields */ }
Expand description

Create a recipe from traversing a hierarchy from a node

The recipe is a Vec of NodeEnumOps which describe entirely how to traverse the hierarchy; essentially it is a record of an enumeration of a hierarchy or part of a hierarchy

Implementations§

Source§

impl Recipe

Source

pub fn new() -> Self

Create a new recipe

Source

pub fn add_op(&mut self, op: NodeEnumOp<usize>)

Add a new operation to the recipe

Source

pub fn take(self) -> (usize, Vec<NodeEnumOp<usize>>)

Deconstruct the recipe

Source

pub fn depth(&self) -> usize

Find the maximum depth of the recipe

Source

pub fn borrow_ops(&self) -> &Vec<NodeEnumOp<usize>>

Borrow the operations that make the recipe

Source

pub fn of_ops<T>(iter: NodeEnum<'_, T>) -> Self
where T: Debug,

Create a recipe from a NodeEnum iterator

Trait Implementations§

Source§

impl Debug for Recipe

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Recipe

Source§

fn default() -> Self

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

Auto Trait Implementations§

§

impl Freeze for Recipe

§

impl RefUnwindSafe for Recipe

§

impl Send for Recipe

§

impl Sync for Recipe

§

impl Unpin for Recipe

§

impl UnwindSafe for Recipe

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, 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.