#[repr(u8)]
#[non_exhaustive]
pub enum Tag {
    Manifest,
    Index,
    Atoms,
    Volume,
    ChecksumNone,
    ChecksumSha256,
    SignatureNone,
    Directory,
    File,
}Expand description
Unique identifiers used to indicate various components of a WEBC file.
Top-Level Sections
In general, all top-level sections are Type-Length-Value encoded.
Tag(u8)- Length (
u64LE) - Value (
Lengthbytes) 
Versioning
Besides acting as an identifier for various elements in a WEBC file, the
Tag plays an important part in versioning. An item’s layout is tied
to its Tag, so any time the layout is changed, a new unique Tag
should be created.
For example, if the format for a volume needs to be changed, a new
Tag::VolumeV2 variant would be added instead of modifying the spec for
existing volumes. Future reader implementations then need to handle
Tag::Volume and Tag::VolumeV2 gracefully.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Manifest
The manifest section, containing a CBOR-serialized
crate::metadata::Manifest.
Index
The index section, containing a CBOR-serialized crate::v2::Index.
The index section is laid out as follows:
Tag::Index- overall section length (
u64LE) - CBOR data
 - padding
 
Note to Implementors
This section may contain trailing padding bytes that should be ignored when deserializing the index.
Depending on the writer implementation, padding bytes may be necessary
because the crate::v2::Index needs to be at the start of a WEBC file,
yet it can only be calculated after everything has been serialized.
Atoms
The atoms section.
An atoms section is laid out similar to Tag::Volume.
Tag::Atoms- overall section length (
u64LE) - volume header length (
u64LE) - volume header
 - volume data length (
u64LE) - volume data
 
Volume
The volume section.
A volume section is laid out similar to Tag::Atoms.
Tag::Volume- overall section length
 - volume name length (
u64LE) - volume name (
u64LE) - volume header length (
u64LE) - volume header
 - volume data length (
u64LE) - volume data
 
ChecksumNone
A tag for the empty checksum (i.e. crate::v2::Checksum::none()).
ChecksumSha256
A tag indicating that the crate::v2::Checksum is calculated using the
SHA-256 hash of a section’s contents.
See also, crate::v2::Checksum::sha256().
SignatureNone
A tag for the empty signature (i.e. crate::v2::Signature::none()).
Directory
Metadata for a directory in the Tag::Volume header.
Each directory follows the type-length-value format.
Tag::Directory- overall directory length (
u64LE) - zero or more entries
 
Where each entry is
- offset of the entry relative to the start of the header (
u64LE) - name length (
u64LE) - name (arbitrary number of bytes)
 
File
Metadata for a file in the Tag::Volume header.
File metadata follows the following format:
Tag::File- start offset in data section (
u64LE) - end offset in data section (
u64LE) - SHA256 checksum (32 bytes)
 
Implementations§
Trait Implementations§
source§impl<'de> Deserialize<'de> for Tag
 
impl<'de> Deserialize<'de> for Tag
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>,
impl Copy for Tag
impl Eq for Tag
impl StructuralEq for Tag
impl StructuralPartialEq for Tag
Auto Trait Implementations§
impl RefUnwindSafe for Tag
impl Send for Tag
impl Sync for Tag
impl Unpin for Tag
impl UnwindSafe for Tag
Blanket Implementations§
source§impl<Q, K> Equivalent<K> for Qwhere
    Q: Eq + ?Sized,
    K: Borrow<Q> + ?Sized,
 
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
 
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.source§impl<Q, K> Equivalent<K> for Qwhere
    Q: Eq + ?Sized,
    K: Borrow<Q> + ?Sized,
 
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
 
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.