Struct sleep_parser::Header

source ·
pub struct Header {
    pub file_type: FileType,
    pub protocol_version: ProtocolVersion,
    pub entry_size: u16,
    pub hash_type: HashType,
}
Expand description

Structural representation of 32 byte SLEEP headers.

Fields§

§file_type: FileType

Type of file.

§protocol_version: ProtocolVersion

Version of the SLEEP protocol.

§entry_size: u16

Size of each piece of data in the file body.

§hash_type: HashType

Algorithm used for hashing the content.

Implementations§

Create a new Header.

Parse a 32 byte buffer slice into a valid Header.

Convert a Header into a Vec<u8>. Use this to persist a header back to disk.

Check whether the header is formatted as a .bitfield.

Check whether the header is formatted as a .signatures.

Check whether the header is formatted as a .tree.

Trait Implementations§

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.