pub struct FleetInventory {
pub machines: Vec<MachineConfig>,
pub origins: BTreeMap<String, InfraOrigin>,
pub sources: SourcesConfig,
pub contributions: Vec<SourceContribution>,
}Expand description
A camp’s resolved machine inventory: the answer to “which machines does
this camp have”, with exactly one implementation
(resolve_fleet_inventory) behind it (R870-B13).
A borrowing camp — one whose own .yah/infra/machines/ is empty and which
declares [[source]] links to another camp’s fleet in
.yah/infra/sources.toml — is the case this type exists for. Before it,
the overlay was applied inline inside CloudConfig::load, so the two
callers that resolve a machine name to a machine (ingress collation and
the sovereign apex render) read a camp-local-only loader and saw an empty
fleet. There was no bug in either of them; the inventory simply had two
readers that disagreed about what the inventory was.
Fields§
§machines: Vec<MachineConfig>Camp-local machines first, then each source’s contribution in declaration order. Camp-local wins any name collision; among sources, the earlier-declared one wins.
origins: BTreeMap<String, InfraOrigin>Provenance for the borrowed entries, keyed by MachineConfig::name.
A name absent here is camp-local. Same shape and meaning as
CloudConfig::machine_origins, which is populated from this.
sources: SourcesConfigThe parsed .yah/infra/sources.toml, kept so a caller that already has
an inventory in hand does not re-read it (CloudConfig::load overlays
providers from the same list).
contributions: Vec<SourceContribution>Per-source accounting — see SourceContribution.
Implementations§
Source§impl FleetInventory
impl FleetInventory
Sourcepub fn describe_sources(&self) -> String
pub fn describe_sources(&self) -> String
One line per declared [[source]], for attaching to the error a caller
raises when a machine name does not resolve (R870-B13).
The failure being diagnosed is always “I was told about machine X and
cannot find it”, and the three ways a borrowing camp gets there — no
link declared, a link pointing somewhere that is not a camp, a link
whose select filtered X out — are indistinguishable from the name
alone. Empty string when the camp declares no sources, so the caller
can append it unconditionally without emitting a dangling header.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for FleetInventory
impl RefUnwindSafe for FleetInventory
impl Send for FleetInventory
impl Sync for FleetInventory
impl Unpin for FleetInventory
impl UnsafeUnpin for FleetInventory
impl UnwindSafe for FleetInventory
Blanket Implementations§
impl<T> Allocation for T
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
impl<T> ErasedDestructor for Twhere
T: 'static,
impl<T> Fruit for T
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more