Skip to main content

TraverseControl

Enum TraverseControl 

Source
pub enum TraverseControl<S, U> {
    ContinueWithScope(S),
    Continue,
    SkipBranch,
    Return(U),
}
Expand description

Flow control for tree traverals.

Variants§

§

ContinueWithScope(S)

Normal control flow: continue recursing into the children.

Pass the state &S to all children.

§

Continue

Normal control flow: continue recursing into the children.

The state that was passed to the parent will be re-used for the children.

§

SkipBranch

Skip this branch of the tree.

§

Return(U)

Finish traversing immediately (and return a value).

Trait Implementations§

Source§

impl<S, U> From<Option<U>> for TraverseControl<S, U>

Source§

fn from(value: Option<U>) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

§

impl<S, U> Freeze for TraverseControl<S, U>
where S: Freeze, U: Freeze,

§

impl<S, U> RefUnwindSafe for TraverseControl<S, U>

§

impl<S, U> Send for TraverseControl<S, U>
where S: Send, U: Send,

§

impl<S, U> Sync for TraverseControl<S, U>
where S: Sync, U: Sync,

§

impl<S, U> Unpin for TraverseControl<S, U>
where S: Unpin, U: Unpin,

§

impl<S, U> UnsafeUnpin for TraverseControl<S, U>
where S: UnsafeUnpin, U: UnsafeUnpin,

§

impl<S, U> UnwindSafe for TraverseControl<S, U>
where S: UnwindSafe, U: 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, U> ExactFrom<T> for U
where U: TryFrom<T>,

Source§

fn exact_from(value: T) -> U

Source§

impl<T, U> ExactInto<U> for T
where U: ExactFrom<T>,

Source§

fn exact_into(self) -> U

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> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T, U> OverflowingInto<U> for T
where U: OverflowingFrom<T>,

Source§

impl<T, U> RoundingInto<U> for T
where U: RoundingFrom<T>,

Source§

impl<T, U> SaturatingInto<U> for T
where U: SaturatingFrom<T>,

Source§

impl<T, U> TryConvert<'_, T> for U
where U: TryFrom<T>,

Source§

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

Source§

fn try_convert( _: &AstAlloc, from: T, ) -> Result<U, <U as TryConvert<'_, T>>::Error>

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.
Source§

impl<T, U> WrappingInto<U> for T
where U: WrappingFrom<T>,

Source§

fn wrapping_into(self) -> U