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
fn id(&self) -> &Id
Returns the identifier of the chunk.
fn decode_data<R: Read>(id: &Id, reader: R) -> Result<Self> where
Self: Sized,
Self: Sized,
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).
fn encode_data<W: Write>(&self, writer: W) -> Result<()>
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
fn decode<R: Read>(reader: R) -> Result<Self> where
Self: Sized,
Self: Sized,
Reads a chunk from reader
.
fn encode<W: Write>(&self, writer: W) -> Result<()>
Writes the chunk to writer
.
Implementors
impl Chunk for RawChunk
impl Chunk for AtomChunk
impl Chunk for CodeChunk
impl Chunk for StrTChunk
impl Chunk for ImpTChunk
impl Chunk for ExpTChunk
impl Chunk for LitTChunk
impl Chunk for LocTChunk
impl Chunk for FunTChunk
impl Chunk for AttrChunk
impl Chunk for CInfChunk
impl Chunk for AbstChunk
impl Chunk for StandardChunk