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>
impl<'a, T, State, NK, EK, S, Progress> GraphWalker<'a, T, State, NK, EK, S, Progress>
pub fn new( g: &'a TypedGraph<NK, EK, S>, ) -> GraphWalker<'a, (), (), NK, EK, S, impl Iterator<Item = ((), SchemaResult<(), NK, EK, S>)>>
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>)>>
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,
Sourcepub 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,
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
Sourcepub 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,
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
pub fn one(self) -> SchemaResult<Option<T>, NK, EK, S>
pub fn one_with_state( self, ) -> SchemaResult<Option<WalkerTarget<T, State>>, NK, EK, S>
pub fn many<TCollection>(self) -> SchemaResult<TCollection, NK, EK, S>where
TCollection: FromIterator<T>,
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>
impl<'a, T: Clone, State, NK, EK, S, Front> Clone for GraphWalker<'a, T, State, NK, EK, S, Front>
Source§fn clone(&self) -> GraphWalker<'a, T, State, NK, EK, S, Front>
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)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto 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>
impl<'a, T, State, NK, EK, S, Front> Sync for GraphWalker<'a, T, State, NK, EK, S, Front>
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> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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