Enum sleep_parser::FileType [−][src]
pub enum FileType { BitField, Signatures, Tree, }
Type of file.
signatures
, bitfield
and tree
are the three SLEEP files. There are two
additional files, key
, and data
, which do not contain SLEEP file headers
and store plain serialized data for easy access. key
stores the public key
that is described by the signatures
file, and data
stores the raw chunk
data that the tree
file contains the hashes and metadata.
Variants
BitField
The bitfield describes which pieces of data you have, and which nodes in the tree file have been written. This file exists as an index of the tree and data to quickly figure out which pieces of data you have or are missing. This file can be regenerated if you delete it, so it is considered a materialized index.
Signatures
A SLEEP formatted 32 byte header with data entries being 64 byte signatures.
Tree
A SLEEP formatted 32 byte header with data entries representing a
serialized Merkle tree based on the data in the data storage layer. All
the fixed size nodes written in in-order tree notation. The header
algorithm string for tree
files is BLAKE2b
. The entry size is 40
bytes.
Methods
impl FileType
[src]
impl FileType
pub fn is_bitfield(&self) -> bool
[src]
pub fn is_bitfield(&self) -> bool
Returns true if the file is BitField
pub fn is_signatures(&self) -> bool
[src]
pub fn is_signatures(&self) -> bool
Returns true if the file is Signatures
pub fn is_tree(&self) -> bool
[src]
pub fn is_tree(&self) -> bool
Returns true if the file is Tree
Trait Implementations
impl Debug for FileType
[src]
impl Debug for FileType
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl PartialEq for FileType
[src]
impl PartialEq for FileType