pub enum WalkerState<Ix = DefaultIx> {
    Done,
    Found(Step<f32, Ix>),
    NotFound(Rc<Step<f32, Ix>>),
    Cutoff,
}
Expand description

State interface for Walker machines.

Each machine performs a step that must return an insight of its current state.

The way state machines inform about their state is with this enum. There are four possible scenarios:

  • WalkerState::Found: The machine has found a solution to the problem
  • WalkerState::Done: There are no more nodes to explore
  • WalkerState::NotFound: This step neither finished nor found the goal but it found an edge anyway
  • WalkerState::Cutoff: The step did not found anything but has not finished yet.

Variants§

§

Done

There are no more nodes to explore

§

Found(Step<f32, Ix>)

A solution was found. Returns the step chain of the solution

§

NotFound(Rc<Step<f32, Ix>>)

Found a node, it is not the solution. A step chain up to this point is returned.

§

Cutoff

Did not found anything. The search is not over, tough.

Implementations§

source§

impl<Ix> WalkerState<Ix>

source

pub fn step_peek(&self) -> Option<&Step<f32, Ix>>

Peek into the step value if available

Trait Implementations§

source§

impl<Ix: Debug> Debug for WalkerState<Ix>

source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<Ix> RefUnwindSafe for WalkerState<Ix>where Ix: RefUnwindSafe,

§

impl<Ix = u32> !Send for WalkerState<Ix>

§

impl<Ix = u32> !Sync for WalkerState<Ix>

§

impl<Ix> Unpin for WalkerState<Ix>where Ix: Unpin,

§

impl<Ix> UnwindSafe for WalkerState<Ix>where Ix: UnwindSafe + RefUnwindSafe,

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere 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 Twhere 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 Twhere 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 Twhere 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.