[][src]Struct ctclient::internal::ConsistencyProofPart

pub struct ConsistencyProofPart {
    pub subtree: (u64, u64),
    pub server_hash: [u8; 32],
}

A subtree hash provided by the server in a consistency proof.

Fields

subtree: (u64, u64)

(start, non-inclusive end)

server_hash: [u8; 32]

The hash of this subtree as from the proof

Implementations

impl ConsistencyProofPart[src]

pub fn verify(&self, leaf_hashes: &[[u8; 32]]) -> Result<(), String>[src]

Verify that an array of leaf_hashes could reconstruct this subtree's server_hash, returning Ok(()) when success and Err(String) when failure, with a string describing the reason of failure.

This function is only useful to those who want to do some custom API calling. If you're using a CTClient, it will handle proof checking for you.

Panic

verify panics when leaf_hashes does not have the right length, which should be subtree.1 - subtree.0.

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.