Skip to main content

LaneGateBoard

Struct LaneGateBoard 

Source
pub struct LaneGateBoard {
    pub lane_id: String,
    pub gates: BTreeMap<String, GateState>,
    pub retries: BTreeMap<String, u32>,
    pub artifacts: Vec<HandoffArtifact>,
}
Expand description

In-memory (and serializable) gate + handoff store for one lane.

Fields§

§lane_id: String§gates: BTreeMap<String, GateState>

Gate id → current state.

§retries: BTreeMap<String, u32>

Retry counters per gate id.

§artifacts: Vec<HandoffArtifact>

Handoff artifacts for this lane.

Implementations§

Source§

impl LaneGateBoard

Source

pub fn new(lane_id: impl Into<String>) -> Self

Source

pub fn install_gates(&mut self, specs: &[GateSpec])

Register gate specs in pending state.

Source

pub fn evaluate( &mut self, spec: &GateSpec, outcome: GateOutcome, ) -> Result<GateState, GateError>

Evaluate a gate against an outcome; updates board state.

Source

pub fn role_is_blocked( &self, specs: &[GateSpec], role: &str, ) -> Option<&GateState>

Whether role is currently blocked by any gate that targets it.

Source

pub fn record_handoff( &mut self, artifact: HandoffArtifact, ) -> Result<(), GateError>

Record a scout→implementer (etc.) handoff artifact.

Source

pub fn latest_handoff( &self, from_role: &str, to_role: &str, kind: &str, ) -> Option<&HandoffArtifact>

Latest handoff of kind from from_role to to_role, if any.

Source

pub fn consume_handoffs_for( &mut self, to_role: &str, limit: usize, ) -> Vec<HandoffArtifact>

Remove and return the latest handoffs addressed to to_role (newest first), up to limit.

Handoffs are single-use: the consumer that receives one is also issued a HandoffConsumed receipt, so leaving the artifact on the board would re-deliver it to every later same-role task — stale evidence, repeated token cost, and a receipt that lies about being spent.

Source

pub fn save_to_dir(&self, dir: &Path) -> Result<PathBuf, GateError>

Persist board under a lane directory (JSON).

Source

pub fn load_from_dir(dir: &Path) -> Result<Self, GateError>

Source

pub fn status_summary(&self) -> Vec<GateStatusLine>

Compact status for lane status / panel surfaces.

Trait Implementations§

Source§

impl Clone for LaneGateBoard

Source§

fn clone(&self) -> LaneGateBoard

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for LaneGateBoard

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Default for LaneGateBoard

Source§

fn default() -> LaneGateBoard

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for LaneGateBoard

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Eq for LaneGateBoard

Source§

impl PartialEq for LaneGateBoard

Source§

fn eq(&self, other: &LaneGateBoard) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for LaneGateBoard

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for LaneGateBoard

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.