pub enum EntryStorage {
Directory,
Verbatim {
label: VerbatimLabel,
size: VerbatimSize,
},
Compressed {
method: CompressionMethod,
stored: Option<u64>,
expanded: Option<u64>,
},
}Expand description
How one container summary entry stores its bytes.
Variants§
Directory
A container directory node that holds no bytes of its own.
Verbatim
Bytes stored verbatim, with whatever the container reports about their size.
Fields
label: VerbatimLabelHow this container spells verbatim storage.
size: VerbatimSizeWhat the container reports about the size.
Compressed
Bytes stored compressed; either size is absent when the codec does not report it.
The two sizes are independent facts: a compressed stream may occupy fewer, the same, or more stored bytes than it expands to (an incompressible deflate member grows), so no pair of reported sizes is invalid and none is a second spelling of another.
Implementations§
Source§impl EntryStorage
impl EntryStorage
Sourcepub const fn verbatim(label: VerbatimLabel, size: u64) -> Self
pub const fn verbatim(label: VerbatimLabel, size: u64) -> Self
Verbatim bytes occupying exactly size stored bytes.
Sourcepub const fn payload_only(label: VerbatimLabel, payload: u64) -> Self
pub const fn payload_only(label: VerbatimLabel, payload: u64) -> Self
Verbatim bytes whose payload is known and whose stored span is not reported.
Sourcepub fn framed(
label: VerbatimLabel,
payload: u64,
stored_span: u64,
) -> Result<Self, &'static str>
pub fn framed( label: VerbatimLabel, payload: u64, stored_span: u64, ) -> Result<Self, &'static str>
Verbatim bytes whose stored span may include container framing.
The two numbers are independently declared by the container, so their order is a fact about the document: a stored span smaller than the payload is a malformed declaration and is rejected here, at the door that reads the container, not at the document wire.
Sourcepub fn framed_by(
label: VerbatimLabel,
payload: AllocatedLen,
framing: NonZeroU32,
) -> Self
pub fn framed_by( label: VerbatimLabel, payload: AllocatedLen, framing: NonZeroU32, ) -> Self
Verbatim bytes whose stored span is the payload plus framing bytes of
container framing the producer knows.
Total: FramedSpan::from_parts mints every (payload, framing) pair
a live allocation and a u32 framing can state.
Sourcepub const fn unreported(label: VerbatimLabel) -> Self
pub const fn unreported(label: VerbatimLabel) -> Self
Verbatim bytes whose size the container does not report.
Sourcepub fn stored_size(&self) -> Option<u64>
pub fn stored_size(&self) -> Option<u64>
Stored span in bytes, absent when the container reports none.
Sourcepub fn expanded_size(&self) -> Option<u64>
pub fn expanded_size(&self) -> Option<u64>
Expanded size in bytes, absent when the container reports none.