Skip to main content

FleetSnapshot

Struct FleetSnapshot 

Source
pub struct FleetSnapshot { /* private fields */ }
Expand description

The immutable value captured at Workflow start.

Fields are private and there are no setters: once captured, the only way to change a snapshot is to take a new one.

Implementations§

Source§

impl FleetSnapshot

Source

pub fn capture( fleet: QualifiedFleetId, document: &FleetDocument, captured_at: impl Into<String>, router: Option<CapturedReasoningRouter>, ) -> Result<Self, ExactFleetError>

Capture a snapshot from a parsed fleet document and an already-resolved Reasoning Router service.

Exact rosters are revalidated here, not trusted. ExactFleet is public and Deserialize, so a document can reach this point without having passed the TOML parser’s invariant checks; capture is the last place to catch a duplicate role, an id/role collision, or a worker claiming the Router’s identity before those become a running Workflow.

router is the captured service, whether it came from a saved reusable profile or was normalized out of the legacy inline form. Resolution happens in the host because it needs the fleet search roots; capture only records the result.

Source

pub fn verify_content_hash(&self) -> Result<(), ExactFleetError>

Recompute the canonical content hash and reject a snapshot whose recorded hash does not describe its own contents.

FleetSnapshot is Deserialize and its content_hash is an ordinary field, so a snapshot can reach a launch without ever having passed Self::capture — through a replay file, a cache, or an IPC hop. That hash is then stamped onto the durable receipt as the evidence that a run matched a saved definition, so an unverified one is not weak evidence but false evidence: it asserts a definition the members may not describe.

Call this before anything durable or costly happens. It is cheap (one canonical serialization plus a SHA-256) and it is the only thing standing between a tampered or migrated snapshot and a receipt that vouches for it.

Source

pub fn into_verified(self) -> Result<Self, ExactFleetError>

Self::verify_content_hash, as a guard that yields the snapshot.

Exists so a load path cannot verify and then accidentally go on to use a different value: the only thing this returns is the snapshot it just checked.

Source

pub fn fleet(&self) -> &QualifiedFleetId

Source

pub fn schema_kind(&self) -> &str

Source

pub const fn schema_revision(&self) -> u32

Source

pub fn schema_hash(&self) -> &str

Source

pub fn content_hash(&self) -> &str

Source

pub fn members(&self) -> &[FleetSnapshotMember]

Source

pub fn router(&self) -> Option<&FleetSnapshotRouter>

Source

pub fn legacy_roles(&self) -> &[FleetSnapshotLegacyRole]

Source

pub fn captured_at(&self) -> &str

Source

pub fn member(&self, id: &str) -> Option<&FleetSnapshotMember>

Look up a member by its member id — what addresses a roster entry.

Source

pub fn member_by_role(&self, role: &str) -> Option<&FleetSnapshotMember>

Look up a member by its semantic role — what gates, handoffs, and records use. Kept separate from id lookup so a task can carry a meaningful role while the runtime resolves a distinct profile id.

Both sides resolve through canonical_role_key, so a snapshot frozen from a Fleet saved under a renamed role is still addressable by a gate or handoff that spells the role the old way.

Source

pub fn member_by_id_or_role( &self, id_or_role: &str, ) -> Option<&FleetSnapshotMember>

Look up by id first, then by role. Roster invariants forbid an id/role collision, so this can never be order-dependent.

Source

pub fn has_auto_member(&self) -> bool

Whether any frozen member requested auto reasoning — i.e. whether this Workflow needs a working Reasoning Router at all.

Source

pub fn auto_member_ids(&self) -> Vec<String>

Ids of the members that requested auto, for a startup error that names who actually needs the Router.

Trait Implementations§

Source§

impl Clone for FleetSnapshot

Source§

fn clone(&self) -> FleetSnapshot

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 FleetSnapshot

Source§

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

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

impl<'de> Deserialize<'de> for FleetSnapshot

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 FleetSnapshot

Source§

impl PartialEq for FleetSnapshot

Source§

fn eq(&self, other: &FleetSnapshot) -> 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 FleetSnapshot

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 FleetSnapshot

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.