pub struct CatalogMetadata {
pub schema_version: u32,
pub generated_at_unix: u64,
pub current_hash: String,
pub previous_hash: String,
pub package_count: usize,
pub source_counts: BTreeMap<String, usize>,
}Expand description
Summary metadata for a generated catalog snapshot.
Fields§
§schema_version: u32Schema version of the persisted metadata envelope.
generated_at_unix: u64Unix timestamp captured when the metadata was generated.
current_hash: StringHash of the current catalog payload.
previous_hash: StringHash of the previous catalog payload, when known.
package_count: usizeTotal package count in the snapshot.
source_counts: BTreeMap<String, usize>Number of packages by source name.
Implementations§
Source§impl CatalogMetadata
impl CatalogMetadata
Sourcepub fn build_from_counts(
package_count: usize,
source_counts: BTreeMap<String, usize>,
current_hash: String,
) -> Self
pub fn build_from_counts( package_count: usize, source_counts: BTreeMap<String, usize>, current_hash: String, ) -> Self
Build metadata from aggregate counts and the current payload hash.
Sourcepub fn validate(&self) -> Result<(), ModelError>
pub fn validate(&self) -> Result<(), ModelError>
Validate the schema version and the required hash contract.
Trait Implementations§
Source§impl Clone for CatalogMetadata
impl Clone for CatalogMetadata
Source§fn clone(&self) -> CatalogMetadata
fn clone(&self) -> CatalogMetadata
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CatalogMetadata
impl Debug for CatalogMetadata
Source§impl<'de> Deserialize<'de> for CatalogMetadata
impl<'de> Deserialize<'de> for CatalogMetadata
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for CatalogMetadata
impl RefUnwindSafe for CatalogMetadata
impl Send for CatalogMetadata
impl Sync for CatalogMetadata
impl Unpin for CatalogMetadata
impl UnwindSafe for CatalogMetadata
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more