pub struct Pack { /* private fields */ }Expand description
A parsed, digest-verified pack.
Constructed by Pack::load, Pack::from_bytes, or once for the whole process by
embedded. Every span was bounds- and boundary-checked at construction, so the accessors on
Provider and Operation cannot fail.
Implementations§
Source§impl Pack
impl Pack
Sourcepub fn load(path: impl AsRef<Path>) -> Result<Pack, Error>
pub fn load(path: impl AsRef<Path>) -> Result<Pack, Error>
Read and verify a pack at path — the constructor for a host loading a newer catalogue
than it was built with. Refuses a wrong format version, schema version or digest before
serving any record.
§Errors
Error::Io when the file cannot be read; otherwise everything
from_bytes refuses.
Sourcepub fn schema_version(&self) -> u32
pub fn schema_version(&self) -> u32
The document schema version the pack carries.
Sourcepub fn digest(&self) -> &str
pub fn digest(&self) -> &str
The verified content digest, as lowercase hex — the pack’s identity, usable as a cache key.
Sourcepub fn providers(&self) -> impl ExactSizeIterator<Item = Provider<'_>>
pub fn providers(&self) -> impl ExactSizeIterator<Item = Provider<'_>>
Every provider in the pack, in id order.
Sourcepub fn operations(&self) -> impl ExactSizeIterator<Item = Operation<'_>>
pub fn operations(&self) -> impl ExactSizeIterator<Item = Operation<'_>>
Every operation in the pack, in id order.
Sourcepub fn operations_of<'s>(
&'s self,
provider: &str,
) -> impl Iterator<Item = Operation<'s>> + 's
pub fn operations_of<'s>( &'s self, provider: &str, ) -> impl Iterator<Item = Operation<'s>> + 's
Every operation of one provider, in id order. An unknown provider yields nothing, exactly
as the legacy catalogue’s operations_of does.