Struct typed_graph::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>
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 copy 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>
impl<'a, T, State, NK, EK, S, Front> RefUnwindSafe for GraphWalker<'a, T, State, NK, EK, S, Front>where
EK: Copy + Clone + Eq + PartialEq + Debug + Hash + RefUnwindSafe,
NK: Copy + Clone + Eq + PartialEq + Debug + Hash + RefUnwindSafe,
Front: RefUnwindSafe,
S: 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>
impl<'a, T, State, NK, EK, S, Front> UnwindSafe for GraphWalker<'a, T, State, NK, EK, S, Front>where
EK: Copy + Clone + Eq + PartialEq + Debug + Hash + RefUnwindSafe,
NK: Copy + Clone + Eq + PartialEq + Debug + Hash + RefUnwindSafe,
Front: UnwindSafe,
S: 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