pub trait HeaderCoding {
    type Item;

Show 13 methods fn identifier() -> u32; fn encode_header(&self) -> Vec<u8>; fn version(&self) -> u8; fn decode_content(data: Vec<u8>) -> Result<Self::Item>; fn header_size(&self) -> usize { ... } fn encode_key<K: Into<String>>(key: K) -> Vec<u8> { ... } fn encode_directly(&self) -> Vec<u8> { ... } fn encode_for_key<K: Into<String>>(&self, key: K) -> Vec<u8> { ... } fn decode_header_length<R: Read>(data: &mut R) -> Result<u64> { ... } fn check_identifier<R: Read>(data: &mut R) -> bool { ... } fn check_key_on_position<K: Into<String>, R: Read>(
        data: &mut R,
        key: K
    ) -> bool { ... } fn decode_directly<R: Read>(data: &mut R) -> Result<Self::Item> { ... } fn decode_for_key<K: Into<String>, R: Read>(
        data: &mut R,
        key: K
    ) -> Result<Self::Item> { ... }
}
Expand description

The HeaderCoding trait specifies an interface for the common header methods and the encoding and decoding methods.

Required Associated Types

the return value for decode_content(), decode_directly(), decode_for_key();

Required Methods

returns the identifier (=Magic bytes) of the header.

encodes the header.

returns the version of the header.

decodes the content of the header.

Provided Methods

returns the size of the encoded header (in bytes)

encodes a given key.

encodes the (header) value/object directly (= without key).

encodes a key to the (header) value/object.

decodes the length of the header.

checks if the read identifier is valid for this header.

helper method to check, if the key is on position.

decodes the header directly.

decodes the header for the given key.

Implementors