Skip to main content

EntryStorage

Enum EntryStorage 

Source
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: VerbatimLabel

How this container spells verbatim storage.

§size: VerbatimSize

What 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.

Fields

§method: CompressionMethod

Compression method.

§stored: Option<u64>

Stored size in bytes, absent when the codec does not report it.

§expanded: Option<u64>

Expanded size in bytes, absent when the codec does not report it.

Implementations§

Source§

impl EntryStorage

Source

pub const fn verbatim(label: VerbatimLabel, size: u64) -> Self

Verbatim bytes occupying exactly size stored bytes.

Source

pub const fn payload_only(label: VerbatimLabel, payload: u64) -> Self

Verbatim bytes whose payload is known and whose stored span is not reported.

Source

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.

Source

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.

Source

pub const fn unreported(label: VerbatimLabel) -> Self

Verbatim bytes whose size the container does not report.

Source

pub fn stored_size(&self) -> Option<u64>

Stored span in bytes, absent when the container reports none.

Source

pub fn expanded_size(&self) -> Option<u64>

Expanded size in bytes, absent when the container reports none.

Trait Implementations§

Source§

impl Clone for EntryStorage

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for EntryStorage

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for EntryStorage

Source§

impl PartialEq for EntryStorage

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for EntryStorage

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.