pub struct ChunkedPackManifestV1 {
pub version: u8,
pub chunk_size: u32,
pub total_size: u64,
pub chunk_count: u32,
pub chunk_hashes: Vec<PackHash>,
}Expand description
On-the-wire manifest for a chunked pack.
Fields§
§version: u8Wire-format version. Currently always 1.
chunk_size: u32Bytes per non-final chunk. The final chunk is in
(0, chunk_size].
total_size: u64Sum of all chunk lengths, equal to the original pack size.
chunk_count: u32== chunk_hashes.len(). Carried explicitly for cheap size
checks before we allocate the Vec on decode.
chunk_hashes: Vec<PackHash>BLAKE3-32 of each chunk’s bytes, in stream order.
Implementations§
Source§impl ChunkedPackManifestV1
impl ChunkedPackManifestV1
Sourcepub fn from_chunks(chunk_size: u32, chunks: &[Vec<u8>]) -> Self
pub fn from_chunks(chunk_size: u32, chunks: &[Vec<u8>]) -> Self
Build a fresh manifest from the chunked pack bytes.
Sourcepub fn from_bytes(bytes: &[u8]) -> Result<Self, ManifestError>
pub fn from_bytes(bytes: &[u8]) -> Result<Self, ManifestError>
Decode from bytes and run Self::validate.
Sourcepub fn validate(&self) -> Result<(), ManifestError>
pub fn validate(&self) -> Result<(), ManifestError>
Run all internal-consistency checks. Does NOT verify that the
chunk bytes themselves match chunk_hashes — that is the
fetcher’s job once it actually has the bytes.
Trait Implementations§
Source§impl Clone for ChunkedPackManifestV1
impl Clone for ChunkedPackManifestV1
Source§fn clone(&self) -> ChunkedPackManifestV1
fn clone(&self) -> ChunkedPackManifestV1
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 ChunkedPackManifestV1
impl Debug for ChunkedPackManifestV1
Source§impl<'de> Deserialize<'de> for ChunkedPackManifestV1
impl<'de> Deserialize<'de> for ChunkedPackManifestV1
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
Source§impl PartialEq for ChunkedPackManifestV1
impl PartialEq for ChunkedPackManifestV1
Source§fn eq(&self, other: &ChunkedPackManifestV1) -> bool
fn eq(&self, other: &ChunkedPackManifestV1) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for ChunkedPackManifestV1
impl Serialize for ChunkedPackManifestV1
impl Eq for ChunkedPackManifestV1
impl StructuralPartialEq for ChunkedPackManifestV1
Auto Trait Implementations§
impl Freeze for ChunkedPackManifestV1
impl RefUnwindSafe for ChunkedPackManifestV1
impl Send for ChunkedPackManifestV1
impl Sync for ChunkedPackManifestV1
impl Unpin for ChunkedPackManifestV1
impl UnsafeUnpin for ChunkedPackManifestV1
impl UnwindSafe for ChunkedPackManifestV1
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