pub struct LegacyCatalog { /* private fields */ }Expand description
The audited catalog of pre-schema releases.
Implementations§
Source§impl LegacyCatalog
impl LegacyCatalog
Sourcepub fn embedded() -> Self
pub fn embedded() -> Self
The catalog this binary carries.
A catalog that does not parse is a build defect rather than a state a command can meet, and the canon suite parses the same bytes.
§Panics
Never in a shipped build, for the reason above.
Sourcepub fn entry(&self, version: &str) -> Option<&CatalogEntry>
pub fn entry(&self, version: &str) -> Option<&CatalogEntry>
What the catalog says about one version.
Sourcepub const fn index(&self) -> &CatalogIndex
pub const fn index(&self) -> &CatalogIndex
The index itself, for the canon suite and the diagnostics.
Sourcepub const fn descriptors(&self) -> &BTreeMap<String, String>
pub const fn descriptors(&self) -> &BTreeMap<String, String>
Every descriptor, by version.
Sourcepub fn descriptor(
&self,
version: &str,
) -> Result<(Descriptor, Sha256), AppError>
pub fn descriptor( &self, version: &str, ) -> Result<(Descriptor, Sha256), AppError>
The descriptor one version resolves to, checked against the index.
§Errors
AppError::Refused when the version is unavailable, uncataloged,
or whose descriptor no longer matches the digest the index records.
Sourcepub fn adapt(
&self,
version: &str,
files: &BTreeMap<String, Vec<u8>>,
) -> Result<Adapted, AppError>
pub fn adapt( &self, version: &str, files: &BTreeMap<String, Vec<u8>>, ) -> Result<Adapted, AppError>
Overlay a descriptor’s facts onto one pre-schema archive.
§Errors
AppError::Refused when the version is not cataloged, when the
descriptor disagrees with the archive it describes, or when the
overlay cannot be rendered.
Trait Implementations§
Source§impl Clone for LegacyCatalog
impl Clone for LegacyCatalog
Source§fn clone(&self) -> LegacyCatalog
fn clone(&self) -> LegacyCatalog
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more