Skip to main content

FleetDocument

Struct FleetDocument 

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

A parsed fleet file plus the provenance a Workflow snapshot needs.

Implementations§

Source§

impl FleetDocument

Source

pub fn parse(text: &str) -> Result<Self, NamedFleetError>

Parse either form. The exact form is selected by an explicit schema = "exact"; everything else is the legacy form.

Source

pub fn load( path: &Path, expect_name: Option<&str>, ) -> Result<Self, NamedFleetError>

Source

pub fn load_by_name( name: &str, search_roots: &[FleetSearchRoot], ) -> Result<(Self, QualifiedFleetId), NamedFleetError>

Load a fleet document by name from labelled search roots.

A bare name that exists under more than one origin is ambiguous once any candidate is an exact fleet: a personal ~/.codewhale Fleet silently shadowing (or being shadowed by) a project Fleet would change which exact provider/model actually runs, so the caller is asked for a qualified origin/name instead. Purely legacy collisions keep the historic first-hit-wins behavior, because a role→profile map resolves through the same profile store either way.

Ambiguity is decided from a schema-key probe, not from a full parse of every candidate: a malformed file in a shadowed origin must not break a legacy load that has always worked. A file whose TOML does not even parse therefore counts as legacy for this decision, and the first hit still wins — the same outcome the pre-exact loader gave.

Accepts origin/name to name one origin explicitly.

Source

pub fn name(&self) -> &str

Source

pub fn description(&self) -> Option<&str>

Source

pub fn schema(&self) -> &FleetSchema

Source

pub const fn is_legacy(&self) -> bool

Explicit legacy detection — never inferred from a missing table.

Source

pub fn legacy(&self) -> Option<&NamedFleet>

Source

pub fn exact(&self) -> Option<&ExactFleet>

Source

pub fn schema_kind(&self) -> &'static str

Source

pub fn schema_revision(&self) -> u32

Source

pub fn source_hash(&self) -> &str

SHA-256 of the exact file bytes this document was parsed from.

Source

pub fn source_path(&self) -> Option<&Path>

Trait Implementations§

Source§

impl Clone for FleetDocument

Source§

fn clone(&self) -> FleetDocument

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 FleetDocument

Source§

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

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

impl Eq for FleetDocument

Source§

impl PartialEq for FleetDocument

Source§

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

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

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

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for FleetDocument

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