pub struct ChunkDescriptor {
pub chunk_type: ChunkType,
pub offset: u64,
pub size_uncompressed: u64,
pub size_compressed: u64,
pub flags: u32,
}Expand description
One 32-byte chunk directory entry.
Fields§
§chunk_type: ChunkTypeFour-letter chunk type tag.
offset: u64Absolute byte offset of the payload. 0 marks a null descriptor.
size_uncompressed: u64Payload size after decompression.
size_compressed: u64Stored size including any AEAD framing, or 0 for a raw payload.
flags: u32Chunk-specific flags: bit 4 is ENCRYPTED, and PREV/EXTD define more.
Implementations§
Source§impl ChunkDescriptor
impl ChunkDescriptor
Sourcepub const NULL: ChunkDescriptor
pub const NULL: ChunkDescriptor
A descriptor occupying no space, as a writer pre-allocating directory slots would leave it.
Sourcepub fn parse(buf: &[u8]) -> Result<ChunkDescriptor>
pub fn parse(buf: &[u8]) -> Result<ChunkDescriptor>
Parse one descriptor.
Sourcepub fn is_encrypted(&self) -> bool
pub fn is_encrypted(&self) -> bool
Whether this payload is sealed.
Sourcepub fn stored_len(&self) -> u64
pub fn stored_len(&self) -> u64
The on-disk byte length of this chunk: size_uncompressed for a raw
payload, size_compressed when the chunk is compressed or sealed.
A LAYR chunk reads both ways round without ambiguity: its
size_uncompressed is the container’s byte length - the version field
plus the frame - and size_compressed is zero while that frame is in the
clear and the same total once it is sealed.
Trait Implementations§
Source§impl Clone for ChunkDescriptor
impl Clone for ChunkDescriptor
Source§fn clone(&self) -> ChunkDescriptor
fn clone(&self) -> ChunkDescriptor
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more