pub enum VariantMerkleTree {
    Sha2_256(VecMerkleTree<Sha2_256Node>),
}

Variants§

Implementations§

Trait Implementations§

source§

impl<'de> Deserialize<'de> for VariantMerkleTree

source§

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

source§

fn from(val: &'_enum VariantMerkleTree) -> MerkleTreeKind

Converts to this type from the input type.
source§

impl From<VariantMerkleTree> for MerkleTreeKind

source§

fn from(val: VariantMerkleTree) -> MerkleTreeKind

Converts to this type from the input type.
source§

impl MerkleTree for VariantMerkleTree

source§

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]>

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§

fn verify(&self, offset: usize, data: &[u8]) -> Result<()>

Verifies that the given data stored from the given offset into the protected data, has not been modified.
source§

fn write(&mut self, offset: usize, data: &[u8]) -> Result<()>

Hashes the given data, adds a new node to the tree with its hash and updates the hashes of all parent nodes.
source§

impl Sectored for VariantMerkleTree

source§

fn sector_sz(&self) -> usize

Returns the size of the sector for this stream.
source§

fn sector_sz64(&self) -> u64

Returns the sector size as a u64.
source§

fn assert_sector_sz(&self, actual: usize) -> Result<()>

Returns Err(Error::IncorrectSize) if the given size is not equal to the sector size.
source§

fn assert_at_least_sector_sz(&self, actual: usize) -> Result<()>

Returns Err(Error::IncorrectSize) if the given size is less than the sector size.
source§

fn offset_at(&self, index: u64) -> u64

Returns the offset (in bytes) from the beginning of this stream that the given 0-based sector index corresponds to.
source§

impl Serialize for VariantMerkleTree

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> Free for T

§

unsafe default fn free(ptr_ref: NonNull<T>)

Drops the content pointed by this pointer and frees it. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

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

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> DeserializeOwned for Twhere T: for<'de> Deserialize<'de>,