pub struct FleetDocument { /* private fields */ }Expand description
A parsed fleet file plus the provenance a Workflow snapshot needs.
Implementations§
Source§impl FleetDocument
impl FleetDocument
Sourcepub fn parse(text: &str) -> Result<Self, NamedFleetError>
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.
pub fn load( path: &Path, expect_name: Option<&str>, ) -> Result<Self, NamedFleetError>
Sourcepub fn load_by_name(
name: &str,
search_roots: &[FleetSearchRoot],
) -> Result<(Self, QualifiedFleetId), NamedFleetError>
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.
pub fn name(&self) -> &str
pub fn description(&self) -> Option<&str>
pub fn schema(&self) -> &FleetSchema
Sourcepub const fn is_legacy(&self) -> bool
pub const fn is_legacy(&self) -> bool
Explicit legacy detection — never inferred from a missing table.
pub fn legacy(&self) -> Option<&NamedFleet>
pub fn exact(&self) -> Option<&ExactFleet>
pub fn schema_kind(&self) -> &'static str
pub fn schema_revision(&self) -> u32
Sourcepub fn source_hash(&self) -> &str
pub fn source_hash(&self) -> &str
SHA-256 of the exact file bytes this document was parsed from.
pub fn source_path(&self) -> Option<&Path>
Trait Implementations§
Source§impl Clone for FleetDocument
impl Clone for FleetDocument
Source§fn clone(&self) -> FleetDocument
fn clone(&self) -> FleetDocument
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more