Skip to main content

Catalog

Struct Catalog 

Source
pub struct Catalog(/* private fields */);
Expand description

Immutable, cheaply cloneable template snapshot.

Implementations§

Source§

impl Catalog

Source

pub fn try_new( manifest: SourceManifest, profile: CatalogProfile, templates: Vec<SetTemplate>, ) -> Result<Self, CatalogError>

Build a snapshot for CatalogProfile::Official or CatalogProfile::Custom. Fails on duplicate/empty template names or a manifest set-count mismatch; use crate::overlay to build a CatalogProfile::Corrected snapshot instead, since this rejects that profile directly.

Source

pub fn get(&self, name: &str) -> Option<&SetTemplate>

Look up a set template by its exact Name.

Source

pub fn iter(&self) -> impl ExactSizeIterator<Item = &SetTemplate>

Iterate every set template in this snapshot, in load order.

Source

pub fn len(&self) -> usize

Total number of set templates in this snapshot.

Source

pub fn is_empty(&self) -> bool

True when the snapshot holds no set templates.

Source

pub fn profile(&self) -> CatalogProfile

Source-policy profile this snapshot was built with.

Source

pub fn manifest(&self) -> &SourceManifest

Source manifest this snapshot was built from.

Source

pub fn applied_patches(&self) -> &[AppliedPatch]

Overlay patches that were applied to reach this snapshot, empty unless profile() is CatalogProfile::Corrected or CatalogProfile::Custom.

Source

pub fn advisories_for(&self, template: &str) -> Vec<&Advisory>

Advisories targeting the named template, empty if none apply.

Source§

impl Catalog

Source

pub fn schema_diagnostics( &self, schema: &impl CatalogSchema, ) -> Vec<CatalogDiagnostic>

Validate entity and value-type references against the selected IFC schema.

Source§

impl Catalog

Source

pub fn diagnostics(&self) -> Vec<CatalogDiagnostic>

Report source-shape defects without changing official definitions.

Source§

impl Catalog

Source

pub fn with_patches( &self, profile: CatalogProfile, patches: &[Patch], ) -> Result<Self, PatchError>

Apply an ordered patch list to a new immutable snapshot.

Source§

impl Catalog

Source

pub fn applicable_to<'a>( &'a self, target: &ApplicabilityTarget, hierarchy: &impl EntityHierarchy, ) -> Vec<&'a SetTemplate>

Return templates applicable to an entity and optional predefined type.

Unknown schema entities are omitted. Use Catalog::query_applicability when that distinction matters.

Source

pub fn query_applicability<'a>( &'a self, target: &ApplicabilityTarget, hierarchy: &impl EntityHierarchy, ) -> ApplicabilityQuery<'a>

Query applicability while preserving unknown-schema outcomes.

Trait Implementations§

Source§

impl Clone for Catalog

Source§

fn clone(&self) -> Catalog

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 Catalog

Source§

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

Formats the value using the given formatter. Read more

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.