pub struct MultiKeyProof {
pub root: Option<Cid>,
pub keys: Vec<Vec<u8>>,
pub path: Vec<Node>,
}Expand description
Shared root proof for multiple keys.
The path vector stores each proof node at most once. Verification follows
the root-to-leaf route for every key through this node set and preserves the
original key order in MultiKeyProofVerification::results.
Fields§
§root: Option<Cid>Root CID the node set claims to prove against, or None for an empty
tree.
keys: Vec<Vec<u8>>Keys being proven, in caller-requested order.
path: Vec<Node>De-duplicated nodes needed to prove all keys. Empty when root is
None or keys is empty.
Implementations§
Source§impl MultiKeyProof
impl MultiKeyProof
Sourcepub fn verify(&self) -> MultiKeyProofVerification
pub fn verify(&self) -> MultiKeyProofVerification
Verify this proof without consulting a store.
Sourcepub fn path_node_bytes(&self) -> Vec<Vec<u8>>
pub fn path_node_bytes(&self) -> Vec<Vec<u8>>
Return the de-duplicated proof nodes as deterministic encoded bytes.
Sourcepub fn from_node_bytes(
root: Option<Cid>,
keys: Vec<Vec<u8>>,
path_node_bytes: Vec<Vec<u8>>,
) -> Result<Self, Error>
pub fn from_node_bytes( root: Option<Cid>, keys: Vec<Vec<u8>>, path_node_bytes: Vec<Vec<u8>>, ) -> Result<Self, Error>
Rebuild a typed proof from encoded path nodes.
Sourcepub fn to_bundle_bytes(&self) -> Result<Vec<u8>, Error>
pub fn to_bundle_bytes(&self) -> Result<Vec<u8>, Error>
Serialize this proof as a versioned, deterministic binary bundle.
Sourcepub fn from_bundle_bytes(bytes: &[u8]) -> Result<Self, Error>
pub fn from_bundle_bytes(bytes: &[u8]) -> Result<Self, Error>
Decode a proof from bytes produced by MultiKeyProof::to_bundle_bytes.
Trait Implementations§
Source§impl Clone for MultiKeyProof
impl Clone for MultiKeyProof
Source§fn clone(&self) -> MultiKeyProof
fn clone(&self) -> MultiKeyProof
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for MultiKeyProof
impl Debug for MultiKeyProof
Source§impl PartialEq for MultiKeyProof
impl PartialEq for MultiKeyProof
impl StructuralPartialEq for MultiKeyProof
Auto Trait Implementations§
impl Freeze for MultiKeyProof
impl RefUnwindSafe for MultiKeyProof
impl Send for MultiKeyProof
impl Sync for MultiKeyProof
impl Unpin for MultiKeyProof
impl UnsafeUnpin for MultiKeyProof
impl UnwindSafe for MultiKeyProof
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more