pub struct ResultProof { /* private fields */ }Expand description
Canonical result proof with an embedded request and result.
Implementations§
Source§impl ResultProof
impl ResultProof
Sourcepub fn anchor(&self) -> &ProofAnchor
pub fn anchor(&self) -> &ProofAnchor
Returns the exact snapshot/log anchor.
Sourcepub fn anchor_digest(&self) -> [u8; 32]
pub fn anchor_digest(&self) -> [u8; 32]
Returns the caller-pinnable anchor digest.
Sourcepub fn operation(&self) -> &ProvenOperation
pub fn operation(&self) -> &ProvenOperation
Returns the operation whose result is proven.
Sourcepub fn result(&self) -> &ProvenResult
pub fn result(&self) -> &ProvenResult
Returns the complete proven result.
Sourcepub fn proof_digest(&self) -> [u8; 32]
pub fn proof_digest(&self) -> [u8; 32]
Returns the digest of the complete canonical proof bytes.
Source§impl ResultProof
impl ResultProof
Sourcepub fn for_get(
snapshot: &SnapshotInfo,
key: Vec<u8>,
result: Option<Record>,
) -> Result<Self, ProofError>
pub fn for_get( snapshot: &SnapshotInfo, key: Vec<u8>, result: Option<Record>, ) -> Result<Self, ProofError>
Creates a canonical proof for one exact KV lookup.
§Errors
Returns an error for a noncanonical key/result pair or proof bounds.
Sourcepub fn for_query(
snapshot: &SnapshotInfo,
query: Query,
result: QueryResult,
) -> Result<Self, ProofError>
pub fn for_query( snapshot: &SnapshotInfo, query: Query, result: QueryResult, ) -> Result<Self, ProofError>
Creates a canonical proof for one complete structured query result.
§Errors
Returns an error for unsupported lengths, document bounds, or total proof size.
Sourcepub fn to_bytes(&self) -> Result<Vec<u8>, ProofError>
pub fn to_bytes(&self) -> Result<Vec<u8>, ProofError>
Encodes the complete proof into canonical portable bytes.
§Errors
Returns an error if the proof exceeds a hard bound or contains a noncanonical model value.
Sourcepub fn from_bytes(encoded: &[u8]) -> Result<Self, ProofError>
pub fn from_bytes(encoded: &[u8]) -> Result<Self, ProofError>
Verifies and decodes canonical proof bytes.
§Errors
Returns a framing, version, canonicality, bound, checksum, or digest error.
Trait Implementations§
Source§impl Clone for ResultProof
impl Clone for ResultProof
Source§fn clone(&self) -> ResultProof
fn clone(&self) -> ResultProof
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more