pub struct Catalog(/* private fields */);Expand description
Immutable, cheaply cloneable template snapshot.
Implementations§
Source§impl Catalog
impl Catalog
Sourcepub fn try_new(
manifest: SourceManifest,
profile: CatalogProfile,
templates: Vec<SetTemplate>,
) -> Result<Self, CatalogError>
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.
Sourcepub fn get(&self, name: &str) -> Option<&SetTemplate>
pub fn get(&self, name: &str) -> Option<&SetTemplate>
Look up a set template by its exact Name.
Sourcepub fn iter(&self) -> impl ExactSizeIterator<Item = &SetTemplate>
pub fn iter(&self) -> impl ExactSizeIterator<Item = &SetTemplate>
Iterate every set template in this snapshot, in load order.
Sourcepub fn profile(&self) -> CatalogProfile
pub fn profile(&self) -> CatalogProfile
Source-policy profile this snapshot was built with.
Sourcepub fn manifest(&self) -> &SourceManifest
pub fn manifest(&self) -> &SourceManifest
Source manifest this snapshot was built from.
Sourcepub fn applied_patches(&self) -> &[AppliedPatch]
pub fn applied_patches(&self) -> &[AppliedPatch]
Overlay patches that were applied to reach this snapshot, empty
unless profile() is CatalogProfile::Corrected or CatalogProfile::Custom.
Sourcepub fn advisories_for(&self, template: &str) -> Vec<&Advisory>
pub fn advisories_for(&self, template: &str) -> Vec<&Advisory>
Advisories targeting the named template, empty if none apply.
Source§impl Catalog
impl Catalog
Sourcepub fn schema_diagnostics(
&self,
schema: &impl CatalogSchema,
) -> Vec<CatalogDiagnostic>
pub fn schema_diagnostics( &self, schema: &impl CatalogSchema, ) -> Vec<CatalogDiagnostic>
Validate entity and value-type references against the selected IFC schema.
Source§impl Catalog
impl Catalog
Sourcepub fn diagnostics(&self) -> Vec<CatalogDiagnostic>
pub fn diagnostics(&self) -> Vec<CatalogDiagnostic>
Report source-shape defects without changing official definitions.
Source§impl Catalog
impl Catalog
Sourcepub fn with_patches(
&self,
profile: CatalogProfile,
patches: &[Patch],
) -> Result<Self, PatchError>
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
impl Catalog
Sourcepub fn applicable_to<'a>(
&'a self,
target: &ApplicabilityTarget,
hierarchy: &impl EntityHierarchy,
) -> Vec<&'a SetTemplate>
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.
Sourcepub fn query_applicability<'a>(
&'a self,
target: &ApplicabilityTarget,
hierarchy: &impl EntityHierarchy,
) -> ApplicabilityQuery<'a>
pub fn query_applicability<'a>( &'a self, target: &ApplicabilityTarget, hierarchy: &impl EntityHierarchy, ) -> ApplicabilityQuery<'a>
Query applicability while preserving unknown-schema outcomes.