Trait abxml::model::owned::OwnedBuf

source ·
pub trait OwnedBuf: Debug {
    fn get_token(&self) -> u16;
    fn get_body_data(&self) -> Result<Vec<u8>, Error>;

    fn get_header(&self) -> Result<Vec<u8>, Error> { ... }
    fn to_vec(&self) -> Result<Vec<u8>, Error> { ... }
    fn write_header(&self, buffer: &mut Vec<u8>, body: &[u8]) -> Result<(), Error> { ... }
}
Expand description

Implementors are able to be converted to well formed chunks as expected on ChunkLoaderStream

Required Methods

Token that identifies the current chunk

Return the bytes corresponding to chunk’s body

Provided Methods

Return the bytes corresponding to chunk’s header

Convert the given OwnedBuf to a well formed chunk in form of vector of bytes

Writes the header to the output buffer. It writes token, header size and chunk_size and then the data returned by get_header.

Implementors