Struct GraphWalker

Source
pub struct GraphWalker<'a, T, State, NK, EK, S, Front>
where NK: Key, EK: Key, S: SchemaExt<NK, EK>, State: Clone, Front: Iterator<Item = (State, SchemaResult<T, NK, EK, S>)>,
{ /* private fields */ }

Implementations§

Source§

impl<'a, T, State, NK, EK, S, Progress> GraphWalker<'a, T, State, NK, EK, S, Progress>
where NK: Key, EK: Key, S: SchemaExt<NK, EK>, State: Clone, Progress: Iterator<Item = (State, SchemaResult<T, NK, EK, S>)> + 'a,

Source

pub fn new( g: &'a TypedGraph<NK, EK, S>, ) -> GraphWalker<'a, (), (), NK, EK, S, impl Iterator<Item = ((), SchemaResult<(), NK, EK, S>)>>

Source

pub fn new_from( g: &'a TypedGraph<NK, EK, S>, start: NK, ) -> GraphWalker<'a, &'a S::N, (), NK, EK, S, impl Iterator<Item = ((), SchemaResult<&'a S::N, NK, EK, S>)>>

Source

pub fn set_state<NewState>( self, new_state: NewState, ) -> GraphWalker<'a, T, NewState, NK, EK, S, impl Iterator<Item = (NewState, SchemaResult<T, NK, EK, S>)>>
where NewState: Clone,

Source

pub fn progress<'b, NewT, NextStep, StateAddition, WalkerStep>( self, walker_step: WalkerStep, ) -> GraphWalker<'b, NewT, State, NK, EK, S, impl Iterator<Item = (State, SchemaResult<NewT, NK, EK, S>)> + 'b>
where NewT: 'b, StateAddition: Clone + 'b, <NextStep as IntoIterator>::IntoIter: 'b, NextStep: IntoIterator<Item = (StateAddition, NewT)>, WalkerStep: Fn(T, &'a TypedGraph<NK, EK, S>) -> SchemaResult<NextStep, NK, EK, S> + 'b, 'a: 'b, 'b: 'a,

Moves the walker forward without changing the state of the branch

Source

pub fn progress_with_state<'b, NewT, NextStep, StateAddition, WalkerStep, UpdateState>( self, walker_step: WalkerStep, update_state: UpdateState, ) -> GraphWalker<'b, NewT, State, NK, EK, S, impl Iterator<Item = (State, SchemaResult<NewT, NK, EK, S>)> + 'b>
where NewT: 'b, StateAddition: Clone + 'b, <NextStep as IntoIterator>::IntoIter: 'b, NextStep: IntoIterator<Item = (StateAddition, NewT)>, WalkerStep: Fn(T, &'a TypedGraph<NK, EK, S>) -> SchemaResult<NextStep, NK, EK, S> + 'b, UpdateState: Fn(State, StateAddition) -> State + 'b + Copy, 'a: 'b, 'b: 'a,

Moves the walker forward and adds more data to the state of the branch

Source

pub fn one(self) -> SchemaResult<Option<T>, NK, EK, S>

Source

pub fn one_with_state( self, ) -> SchemaResult<Option<WalkerTarget<T, State>>, NK, EK, S>

Source

pub fn many<TCollection>(self) -> SchemaResult<TCollection, NK, EK, S>
where TCollection: FromIterator<T>,

Source

pub fn many_with_state<TStateCollection>( self, ) -> SchemaResult<TStateCollection, NK, EK, S>
where TStateCollection: FromIterator<WalkerTarget<T, State>>,

Trait Implementations§

Source§

impl<'a, T: Clone, State, NK, EK, S, Front> Clone for GraphWalker<'a, T, State, NK, EK, S, Front>
where NK: Key + Clone, EK: Key + Clone, S: SchemaExt<NK, EK> + Clone, State: Clone + Clone, Front: Iterator<Item = (State, SchemaResult<T, NK, EK, S>)> + Clone,

Source§

fn clone(&self) -> GraphWalker<'a, T, State, NK, EK, S, Front>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Auto Trait Implementations§

§

impl<'a, T, State, NK, EK, S, Front> Freeze for GraphWalker<'a, T, State, NK, EK, S, Front>
where Front: Freeze,

§

impl<'a, T, State, NK, EK, S, Front> RefUnwindSafe for GraphWalker<'a, T, State, NK, EK, S, Front>
where Front: RefUnwindSafe, S: RefUnwindSafe, NK: RefUnwindSafe, EK: RefUnwindSafe, <S as SchemaExt<NK, EK>>::N: RefUnwindSafe, <S as SchemaExt<NK, EK>>::E: RefUnwindSafe,

§

impl<'a, T, State, NK, EK, S, Front> Send for GraphWalker<'a, T, State, NK, EK, S, Front>
where Front: Send, S: Sync, NK: Sync, EK: Sync, <S as SchemaExt<NK, EK>>::N: Sync, <S as SchemaExt<NK, EK>>::E: Sync,

§

impl<'a, T, State, NK, EK, S, Front> Sync for GraphWalker<'a, T, State, NK, EK, S, Front>
where Front: Sync, S: Sync, NK: Sync, EK: Sync, <S as SchemaExt<NK, EK>>::N: Sync, <S as SchemaExt<NK, EK>>::E: Sync,

§

impl<'a, T, State, NK, EK, S, Front> Unpin for GraphWalker<'a, T, State, NK, EK, S, Front>
where Front: Unpin,

§

impl<'a, T, State, NK, EK, S, Front> UnwindSafe for GraphWalker<'a, T, State, NK, EK, S, Front>
where Front: UnwindSafe, S: RefUnwindSafe, NK: RefUnwindSafe, EK: RefUnwindSafe, <S as SchemaExt<NK, EK>>::N: RefUnwindSafe, <S as SchemaExt<NK, EK>>::E: RefUnwindSafe,

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.