Expand description
§Example
extern crate sleep_parser as sleep_parser;
use sleep_parser::{FileType, HashType, Header};
use std::fs::File;
use std::io::{BufRead, BufReader};
let file = File::open("tests/fixtures/content.bitfield").unwrap();
let mut reader = BufReader::with_capacity(32, file);
let buffer = reader.fill_buf().unwrap();
let header = Header::from_vec(&buffer).unwrap();
assert!(header.is_bitfield());
Structs§
- Header
- Structural representation of 32 byte SLEEP headers.
Enums§
- File
Type - Type of file.
- Hash
Type - Algorithm used for hashing the data.
- Protocol
Version - SLEEP Protocol version.
Functions§
- create_
bitfield - Create a new
Header
in theBitfield
configuration. - create_
signatures - Create a new
Header
in theSignatures
configuration. - create_
tree - Create a new
Header
in theTree
configuration.