pub struct GraphRunContext<State, Deps = ()> {
pub state: State,
pub deps: Deps,
pub step: u32,
pub run_id: String,
pub max_steps: u32,
}Expand description
Context passed to nodes during execution.
Fields§
§state: StateCurrent state.
deps: DepsDependencies.
step: u32Current step number.
run_id: StringUnique run identifier.
max_steps: u32Maximum steps allowed.
Implementations§
Source§impl<State, Deps> GraphRunContext<State, Deps>
impl<State, Deps> GraphRunContext<State, Deps>
Sourcepub fn with_max_steps(self, max: u32) -> Self
pub fn with_max_steps(self, max: u32) -> Self
Set maximum steps.
Sourcepub fn increment_step(&mut self)
pub fn increment_step(&mut self)
Increment step counter.
Sourcepub fn is_max_steps_reached(&self) -> bool
pub fn is_max_steps_reached(&self) -> bool
Check if max steps reached.
Trait Implementations§
Source§impl<State: Clone, Deps: Clone> Clone for GraphRunContext<State, Deps>
impl<State: Clone, Deps: Clone> Clone for GraphRunContext<State, Deps>
Source§fn clone(&self) -> GraphRunContext<State, Deps>
fn clone(&self) -> GraphRunContext<State, Deps>
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<State, Deps> Freeze for GraphRunContext<State, Deps>
impl<State, Deps> RefUnwindSafe for GraphRunContext<State, Deps>where
State: RefUnwindSafe,
Deps: RefUnwindSafe,
impl<State, Deps> Send for GraphRunContext<State, Deps>
impl<State, Deps> Sync for GraphRunContext<State, Deps>
impl<State, Deps> Unpin for GraphRunContext<State, Deps>
impl<State, Deps> UnwindSafe for GraphRunContext<State, Deps>where
State: UnwindSafe,
Deps: 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
Mutably borrows from an owned value. Read more