Skip to main content

RunState

Struct RunState 

Source
pub struct RunState<S> {
    pub user: S,
    pub errors: IndexMap<NodeId, BspError>,
    pub step: u64,
    /* private fields */
}
Expand description

The complete schedulable state of one run: consumer state, value store, and all activation accounting. Suspension, resumption, and step-limit results all package this.

Fields§

§user: S

The consumer-owned state. The engine moves it; it never inspects it.

§errors: IndexMap<NodeId, BspError>

The node errors recorded so far (populated by RouteToErrorEdge recovery).

§step: u64

Number of supersteps executed so far (counts toward max_steps).

Implementations§

Source§

impl<S> RunState<S>

Source

pub const fn values(&self) -> &ValueStore

The engine-owned value store.

Source

pub const fn values_mut(&mut self) -> &mut ValueStore

Mutable access to the engine-owned value store (e.g. to restore pin state out of band).

Source

pub const fn iterations(&self) -> &IndexMap<EdgeId, u64>

Per-edge iteration counters, keyed by edge declaration index.

Source

pub const fn executions(&self) -> &IndexMap<NodeId, u64>

Per-node execution counters (counts execute invocations, including retries).

Source

pub fn execution_count(&self, node_id: NodeId) -> u64

How many times a node has executed so far.

Source

pub fn iteration_count(&self, edge: EdgeId) -> u64

How many times an edge has fired against its iteration budget so far.

Source

pub fn get_output_typed<T: Any + Send + Sync + Clone>( &self, pin: OutputPin, ) -> Option<T>

Retrieves a typed value associated with an output pin, if it exists.

Trait Implementations§

Source§

impl<S> BspOutputMapExt for RunState<S>

Source§

fn get_typed<T: Any + Send + Sync + Clone>( &self, pin: OutputPin, ) -> Result<T, BspError>

Typed access to the value store’s output map, so a completed run reads exactly like the dataflow engine’s output map did.

Source§

impl<S: Debug> Debug for RunState<S>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<S> !RefUnwindSafe for RunState<S>

§

impl<S> !UnwindSafe for RunState<S>

§

impl<S> Freeze for RunState<S>
where S: Freeze,

§

impl<S> Send for RunState<S>
where S: Send,

§

impl<S> Sync for RunState<S>
where S: Sync,

§

impl<S> Unpin for RunState<S>
where S: Unpin,

§

impl<S> UnsafeUnpin for RunState<S>
where S: UnsafeUnpin,

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> DebuggableStorage for T
where T: Any + Send + Sync + Debug,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

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.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more