pub enum WalkState<T: WalkStateUnit + Debug + Clone> {
Begin,
Intermediate(T),
Finished(T),
}
Expand description
WalkState contains all information required to traverse offer and expose chains in a tree tracing routes from any point back to their originating source. This includes in the most complex case traversing from a use to offer chain, back through to an expose chain.
Variants§
Implementations§
Source§impl<T: WalkStateUnit + Debug + Clone> WalkState<T>
impl<T: WalkStateUnit + Debug + Clone> WalkState<T>
Sourcepub fn at(state: T) -> Self
pub fn at(state: T) -> Self
Constructs a new WalkState representing the start of a walk after a hard coded initial node. Used to represent framework state with static state definitions such as rights in directories or filters in events.
Sourcepub fn advance(&self, next_state: Option<T>) -> Result<Self, RoutingError>
pub fn advance(&self, next_state: Option<T>) -> Result<Self, RoutingError>
Advances the WalkState if and only if the state passed satisfies the validation.
Sourcepub fn is_finished(&self) -> bool
pub fn is_finished(&self) -> bool
Whether or not the state is Finished.
Sourcepub fn finalize(&self, state: Option<T>) -> Result<Self, RoutingError>
pub fn finalize(&self, state: Option<T>) -> Result<Self, RoutingError>
Finalizes the state preventing future modification, this is called when the walker arrives at a node with a source of Framework, Builtin, Namespace or Self. The provided |state| should always be the state at the CapabilitySource.
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for WalkState<T>where
T: Freeze,
impl<T> RefUnwindSafe for WalkState<T>where
T: RefUnwindSafe,
impl<T> Send for WalkState<T>where
T: Send,
impl<T> Sync for WalkState<T>where
T: Sync,
impl<T> Unpin for WalkState<T>where
T: Unpin,
impl<T> UnwindSafe for WalkState<T>where
T: UnwindSafe,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)