Trait libpna::Chunk

source ·
pub trait Chunk {
    // Required methods
    fn ty(&self) -> ChunkType;
    fn data(&self) -> &[u8] ;

    // Provided methods
    fn length(&self) -> u32 { ... }
    fn crc(&self) -> u32 { ... }
}
Expand description

The smallest data unit in PNA.

Required Methods§

source

fn ty(&self) -> ChunkType

Type of chunk.

source

fn data(&self) -> &[u8]

Data of chunk.

Provided Methods§

source

fn length(&self) -> u32

Length of data in bytes.

source

fn crc(&self) -> u32

CRC32 of chunk type and data.

Implementations on Foreign Types§

source§

impl<T: Deref<Target = [u8]>> Chunk for (ChunkType, T)

source§

fn ty(&self) -> ChunkType

source§

fn data(&self) -> &[u8]

source§

impl<T: Chunk> Chunk for &T

source§

fn ty(&self) -> ChunkType

source§

fn data(&self) -> &[u8]

Implementors§

source§

impl Chunk for RawChunk

source§

impl Chunk for RawChunk<&[u8]>

source§

impl<'a> Chunk for RawChunk<Cow<'a, [u8]>>