Struct sleep_parser::Header
[−]
[src]
pub struct Header {
pub file_type: FileType,
pub protocol_version: ProtocolVersion,
pub entry_size: u16,
pub hash_type: HashType,
}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.
Methods
impl Header[src]
pub fn new(file_type: FileType, entry_size: u16, hash_type: HashType) -> Self[src]
Create a new Header.
pub fn from_vec(buffer: &[u8]) -> Result<Header, Error>[src]
Parse a 32 bit buffer slice into a valid Header.
pub fn to_vec(&self) -> Header[src]
Convert a Header into a Vec<u8>. Use this to persist a header back to
disk.