pub struct Inventory {
pub kinds: BTreeMap<String, Vec<InventoryEntry>>,
}Expand description
Inventory is a top-level map keyed by kind → Vec<Entry>. Kinds are
free-form; the conventional set is documented in docs/storage.md.
Fields§
§kinds: BTreeMap<String, Vec<InventoryEntry>>Implementations§
Source§impl Inventory
impl Inventory
Sourcepub fn entries(&self, kind: &str) -> &[InventoryEntry]
pub fn entries(&self, kind: &str) -> &[InventoryEntry]
Inventory sections are conventionally plural (source_repos,
cloud_accounts) but scope.kind is singular (source_repo,
cloud_account). Look up by exact match first, then by trailing-s
pluralisation.
Sourcepub fn section_for(&self, kind: &str) -> Option<&str>
pub fn section_for(&self, kind: &str) -> Option<&str>
Returns the canonical section name (as it appears in YAML) that satisfies the given scope kind, if any. Used by validation to tell “section is missing” from “kind is genuinely unknown”.
pub fn iter(&self) -> impl Iterator<Item = (&String, &InventoryEntry)>
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Inventory
impl<'de> Deserialize<'de> for Inventory
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Inventory
impl RefUnwindSafe for Inventory
impl Send for Inventory
impl Sync for Inventory
impl Unpin for Inventory
impl UnsafeUnpin for Inventory
impl UnwindSafe for Inventory
Blanket Implementations§
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
Mutably borrows from an owned value. Read more