Trait beam_file::chunk::Chunk [] [src]

pub trait Chunk {
    fn id(&self) -> &Id;
    fn decode_data<R: Read>(id: &Id, reader: R) -> Result<Self>
    where
        Self: Sized
; fn encode_data<W: Write>(&self, writer: W) -> Result<()>; fn decode<R: Read>(reader: R) -> Result<Self>
    where
        Self: Sized
, { ... } fn encode<W: Write>(&self, writer: W) -> Result<()> { ... } }

The Chunk trait represents a type of chunk in a BEAM file.

Required Methods

Returns the identifier of the chunk.

Reads a chunk which has the identifier id from reader.

NOTICE: reader has no chunk header (i.e., the identifier and data size of the chunk).

Writes the data of the chunk to writer.

NOTICE: The header (i.e., identifier and data size) of the chunk must not write in the function.

Provided Methods

Reads a chunk from reader.

Writes the chunk to writer.

Implementors