Struct IncrementalVerifier

Source
pub struct IncrementalVerifier { /* private fields */ }
Expand description

An incremental verifier that can consume a stream of proofs and content and verify the integrity of the content using a blake3 root hash.

Implementations§

Source§

impl IncrementalVerifier

Source

pub fn new(root_hash: [u8; 32], starting_block: usize) -> Self

Create a new incremental verifier that verifies an stream of proofs and content against the provided root hash.

The starting_block determines where the content stream will start from.

Source

pub fn is_done(&self) -> bool

Returns true if the stream is complete.

Source

pub fn verify_hash( &mut self, hash: &[u8; 32], ) -> Result<(), IncrementalVerifierError>

Verify the new block of data only by providing its hash, you should be aware of what mode you have finalized the block at.

Source

pub fn verify( &mut self, block: BlockHasher, ) -> Result<(), IncrementalVerifierError>

Verify the new block.

Source

pub fn feed_proof( &mut self, proof: &[u8], ) -> Result<(), IncrementalVerifierError>

Feed some new proof to the verifier which it can use to expand its internal blake3 tree.

Trait Implementations§

Source§

impl Drop for IncrementalVerifier

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

impl Send for IncrementalVerifier

Auto Trait Implementations§

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. 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 T
where 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 T
where U: Into<T>,

Source§

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 T
where U: TryFrom<T>,

Source§

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.