pub struct Key(/* private fields */);Expand description
Stable, owned identity for a stored, non-delta selected pack. Serialization uses explicit numeric codes and big-endian integers, independent of Rust ABI.
Implementations§
Source§impl Key
impl Key
Sourcepub fn derive(
repository: &impl Repository,
selection: Selection<'_>,
ids: &mut [ObjectId],
) -> Result<Self>
pub fn derive( repository: &impl Repository, selection: Selection<'_>, ids: &mut [ObjectId], ) -> Result<Self>
Require strictly ascending selected indices, as returned by repository
selection. All selects every object. IDs are canonicalized in caller
storage, so equivalent sets have the same key across enumeration orders.
Metadata, format, count, indices and duplicate IDs fail before cache I/O.
Sourcepub fn from_bytes(bytes: &[u8]) -> Result<Self>
pub fn from_bytes(bytes: &[u8]) -> Result<Self>
Parse exactly 48 bytes. Unknown schemas, codecs, revisions, formats and reserved bits are rejected, rather than sharing a future encoder’s keys.
pub fn as_bytes(&self) -> &[u8; 48]
pub fn object_format(self) -> ObjectFormat
pub fn object_count(self) -> u32
Sourcepub fn verify_pack(
self,
bytes: &[u8],
ids: &mut [ObjectId],
byte_limit: usize,
) -> Result<()>
pub fn verify_pack( self, bytes: &[u8], ids: &mut [ObjectId], byte_limit: usize, ) -> Result<()>
Verify framing, checksums, canonical object IDs and exact unique set before any bytes reach an output sink. Requires one caller ID per object; no inflated-body buffer or DEFLATE window is needed for this codec.