pub struct RangeProof {
pub root: Option<Cid>,
pub start: Vec<u8>,
pub end: Option<Vec<u8>>,
pub path: Vec<Node>,
}Expand description
Complete proof for all entries in a key range.
The path vector stores every node needed to verify that all keys in
[start, end) have been included and that no other matching keys are
omitted.
Fields§
§root: Option<Cid>Root CID the node set claims to prove against, or None for an empty
tree.
start: Vec<u8>Inclusive range start.
end: Option<Vec<u8>>Exclusive range end. None means unbounded.
path: Vec<Node>De-duplicated nodes needed to prove the full range.
Implementations§
Source§impl RangeProof
impl RangeProof
Sourcepub fn verify(&self) -> RangeProofVerification
pub fn verify(&self) -> RangeProofVerification
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>,
start: impl Into<Vec<u8>>,
end: Option<Vec<u8>>,
path_node_bytes: Vec<Vec<u8>>,
) -> Result<Self, Error>
pub fn from_node_bytes( root: Option<Cid>, start: impl Into<Vec<u8>>, end: Option<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 RangeProof::to_bundle_bytes.
Trait Implementations§
Source§impl Clone for RangeProof
impl Clone for RangeProof
Source§fn clone(&self) -> RangeProof
fn clone(&self) -> RangeProof
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 RangeProof
impl Debug for RangeProof
Source§impl PartialEq for RangeProof
impl PartialEq for RangeProof
impl StructuralPartialEq for RangeProof
Auto Trait Implementations§
impl Freeze for RangeProof
impl RefUnwindSafe for RangeProof
impl Send for RangeProof
impl Sync for RangeProof
impl Unpin for RangeProof
impl UnsafeUnpin for RangeProof
impl UnwindSafe for RangeProof
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