Enum btlib::crypto::merkle_stream::VariantMerkleTree
source · pub enum VariantMerkleTree {
Sha2_256(VecMerkleTree<Sha2_256Node>),
}
Variants§
Sha2_256(VecMerkleTree<Sha2_256Node>)
Implementations§
source§impl VariantMerkleTree
impl VariantMerkleTree
pub fn empty(kind: MerkleTreeKind, sector_sz: usize) -> VariantMerkleTree
Trait Implementations§
source§impl<'de> Deserialize<'de> for VariantMerkleTree
impl<'de> Deserialize<'de> for VariantMerkleTree
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl<'_enum> From<&'_enum VariantMerkleTree> for MerkleTreeKind
impl<'_enum> From<&'_enum VariantMerkleTree> for MerkleTreeKind
source§fn from(val: &'_enum VariantMerkleTree) -> MerkleTreeKind
fn from(val: &'_enum VariantMerkleTree) -> MerkleTreeKind
Converts to this type from the input type.
source§impl From<VariantMerkleTree> for MerkleTreeKind
impl From<VariantMerkleTree> for MerkleTreeKind
source§fn from(val: VariantMerkleTree) -> MerkleTreeKind
fn from(val: VariantMerkleTree) -> MerkleTreeKind
Converts to this type from the input type.
source§impl MerkleTree for VariantMerkleTree
impl MerkleTree for VariantMerkleTree
source§fn assert_root_contains(&mut self, hash_data: Option<&[u8]>) -> Result<()>
fn assert_root_contains(&mut self, hash_data: Option<&[u8]>) -> Result<()>
Checks that the root node contains the given hash data. If it does then
Ok(())
is
returned. If it doesn’t, then Err(Error::HashCmpFailure)
is returned.source§fn root_hash(&self) -> Result<&[u8]>
fn root_hash(&self) -> Result<&[u8]>
Returns the hash data stored in the root node of the tree. An error is returned if and only
if the tree is empty.
source§impl Sectored for VariantMerkleTree
impl Sectored for VariantMerkleTree
source§fn sector_sz64(&self) -> u64
fn sector_sz64(&self) -> u64
Returns the sector size as a
u64
.source§fn assert_sector_sz(&self, actual: usize) -> Result<()>
fn assert_sector_sz(&self, actual: usize) -> Result<()>
Returns
Err(Error::IncorrectSize)
if the given size is not equal to the sector size.Auto Trait Implementations§
impl RefUnwindSafe for VariantMerkleTree
impl Send for VariantMerkleTree
impl Sync for VariantMerkleTree
impl Unpin for VariantMerkleTree
impl UnwindSafe for VariantMerkleTree
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more