pub enum SearchDirection<W> {
    Abort,
    Left,
    Stop,
    Right(W),
    LeftOrStop,
    RightOrStop(W),
}
Expand description

Represents the directions for the search in accumulate_weight_search.

This enum is used by the user-provided function to indicate how the search should proceed or terminate in accumulate_weight_search.

Variants§

§

Abort

Indicates to abort the search immediately. This stops further searching in any subtree.

§

Left

Indicates to continue the search in the left subtree. This is used when the current search result is unacceptable and the search should move left.

§

Stop

Indicates that the current search result is acceptable and the search should stop.

§

Right(W)

Indicates to continue the search in the right subtree, with the provided weight W. This is used when the current search result is unacceptable and the search should move right. The user function is expected to merge the accumulate weight with the node weight and provide it in this variant to avoid recalculating it in accumulate_weight_search.

§

LeftOrStop

Indicates that the current search result is acceptable, but the search should still continue in the left subtree. If the subtree yields no results, the current result is returned.

§

RightOrStop(W)

Similar to LeftOrStop, but for the right subtree. Indicates that the current search result is acceptable, but the search should still continue in the right subtree. If the subtree yields no results, the current result is returned, along with the merged weight. The user function is expected to merge the accumulate weight with the node weight and provide it in this variant to avoid recalculating it in accumulate_weight_search.

Trait Implementations§

source§

impl<W: Debug> Debug for SearchDirection<W>

source§

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

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

impl<W: PartialEq> PartialEq for SearchDirection<W>

source§

fn eq(&self, other: &SearchDirection<W>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<W: Eq> Eq for SearchDirection<W>

source§

impl<W> StructuralPartialEq for SearchDirection<W>

Auto Trait Implementations§

§

impl<W> RefUnwindSafe for SearchDirection<W>
where W: RefUnwindSafe,

§

impl<W> Send for SearchDirection<W>
where W: Send,

§

impl<W> Sync for SearchDirection<W>
where W: Sync,

§

impl<W> Unpin for SearchDirection<W>
where W: Unpin,

§

impl<W> UnwindSafe for SearchDirection<W>
where W: 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> Same for T

§

type Output = T

Should always be Self
source§

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

§

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

§

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

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V