Skip to main content

EffectRecheckContext

Struct EffectRecheckContext 

Source
pub struct EffectRecheckContext<'a> {
    pub run_id: &'a str,
    pub command_id: &'a str,
    pub definition_revision: &'a str,
    pub expected_revision: &'a str,
    pub expected_generation: u64,
    pub current_generation: u64,
    pub authorization: Option<&'a StrategyAuthorization>,
    pub claimant: &'a str,
    pub session_id: Option<&'a str>,
    pub single_writer_registry: Option<&'a SingleWriterSessionRegistry>,
    pub required_tokens: Option<u64>,
    pub token_budget_remaining: Option<u64>,
}
Expand description

Context evaluated immediately prior to executing any effect.

Fields§

§run_id: &'a str§command_id: &'a str§definition_revision: &'a str§expected_revision: &'a str§expected_generation: u64§current_generation: u64§authorization: Option<&'a StrategyAuthorization>§claimant: &'a str§session_id: Option<&'a str>

Native session this effect will write through, when the executor holds a single-writer registration. None means the executor has no session lock to recheck, not that the lock check passed.

§single_writer_registry: Option<&'a SingleWriterSessionRegistry>§required_tokens: Option<u64>

Tokens this effect is about to spend against a configured pool, and what is left of it. None means no pool fact is available to compare.

§token_budget_remaining: Option<u64>

Implementations§

Source§

impl<'a> EffectRecheckContext<'a>

Source

pub fn for_run_command( run_id: &'a str, snapshot: &'a RunSnapshot, definition: &'a StrategyDefinition, command: &'a RunCommand, claimant: &'a str, ) -> Self

Build the pre-effect recheck context for one command the executor claimed.

The generation check compares two independently sourced facts: the visit the command was minted for (RunCommand::state_visit) against the visit the run is at now (RunSnapshot::state_visits). A command whose state was re-entered, or that was claimed for a state the run has since advanced past, must not reach the executor with stale semantics.

The revision check asserts the run is still bound to the definition it was loaded from. That binding is structural here (the definition is read by snapshot.definition_digest), so the check is an invariant assertion rather than a second read of mutable state.

Session-lock and token-budget facts stay None until the T07.4 node facade and the T04 pool ports are reachable from the executor; see GroupBIntegrationGaps. Callers holding those facts set the fields directly.

Auto Trait Implementations§

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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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> Same for T

Source§

type Output = T

Should always be Self
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.