Skip to main content

ChunkHeader

Trait ChunkHeader 

Source
pub trait ChunkHeader {
    type Metadata: ChunkMetadata;

    // Required methods
    fn id(&self) -> u8;
    fn version(&self) -> u8;
    fn metadata(&self) -> &Self::Metadata;

    // Provided method
    fn bytes(&self) -> Bytes { ... }
}
Expand description

Core trait for chunk header

Required Associated Types§

Source

type Metadata: ChunkMetadata

The metadata type for this chunk

Required Methods§

Source

fn id(&self) -> u8

Get the identifier byte for this chunk type

Source

fn version(&self) -> u8

Get the version byte for this chunk type

Source

fn metadata(&self) -> &Self::Metadata

Get the metadata bytes for this chunk

Provided Methods§

Source

fn bytes(&self) -> Bytes

Get the header bytes for this chunk

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§