pub struct LayerCatalog {
pub version: u32,
pub entries: HashMap<String, CatalogEntry>,
}Expand description
Maps conda package builds to their reproducible OCI layer digest.
Key format: “name==version-build” (e.g. “openssl==3.3.0-h69704a7_0”).
Because bv-builder produces bit-identical compressed layer blobs for the same package triple (SOURCE_DATE_EPOCH + sorted entries + zstd level 19), the digest here is not a cache hint — it is a stable identity. Any future build of the same package will produce the same bytes and therefore the same blob on the registry. Docker/OCI registries deduplicate by content digest, so two images that both contain “openssl==3.3.0” share exactly one copy of that layer on disk and on the wire.
The catalog is stored in the registry repo at layers/catalog.json and
grows incrementally as new tools are published via bv publish --spec.
It replaces the batch-computed popularity.json for user-side publishing:
instead of requiring a full scan of all registry specs, each new tool
greedily adds its solo layers to the catalog, and future builds inherit
the benefit automatically.
Fields§
§version: u32§entries: HashMap<String, CatalogEntry>Implementations§
Source§impl LayerCatalog
impl LayerCatalog
pub fn new() -> Self
pub fn key(name: &str, version: &str, build: &str) -> String
pub fn get( &self, name: &str, version: &str, build: &str, ) -> Option<&CatalogEntry>
pub fn contains(&self, name: &str, version: &str, build: &str) -> bool
Sourcepub fn record(&mut self, name: &str, version: &str, build: &str, digest: &str)
pub fn record(&mut self, name: &str, version: &str, build: &str, digest: &str)
Record a solo layer for this package. If the entry already exists the count is incremented and the digest is updated (same package triple always produces the same digest, so the update is a no-op in practice).
pub fn load(path: &Path) -> Result<Self>
pub fn save(&self, path: &Path) -> Result<()>
pub fn to_json(&self) -> Result<String>
Trait Implementations§
Source§impl Clone for LayerCatalog
impl Clone for LayerCatalog
Source§fn clone(&self) -> LayerCatalog
fn clone(&self) -> LayerCatalog
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more