pub struct CompactEvidenceRef {
pub packet_id: Uuid,
pub chain_hash: String,
pub document_hash: String,
pub summary: CompactSummary,
pub evidence_uri: String,
pub signature: String,
pub metadata: Option<CompactMetadata>,
}Expand description
Cryptographically-bound reference to a full Evidence packet, embeddable in space-constrained contexts.
Fields§
§packet_id: Uuid§chain_hash: StringFinal checkpoint hash
document_hash: String§summary: CompactSummary§evidence_uri: StringWhere the full Evidence can be retrieved
signature: StringEd25519 over the reference fields
metadata: Option<CompactMetadata>Implementations§
Source§impl CompactEvidenceRef
impl CompactEvidenceRef
Sourcepub fn new(
packet_id: Uuid,
chain_hash: String,
document_hash: String,
summary: CompactSummary,
evidence_uri: String,
signature: String,
) -> Self
pub fn new( packet_id: Uuid, chain_hash: String, document_hash: String, summary: CompactSummary, evidence_uri: String, signature: String, ) -> Self
Create a compact reference with required fields.
Sourcepub fn with_metadata(self, metadata: CompactMetadata) -> Self
pub fn with_metadata(self, metadata: CompactMetadata) -> Self
Attach optional metadata (author, verifier, timestamps).
Sourcepub fn signable_payload(&self) -> Vec<u8> ⓘ
pub fn signable_payload(&self) -> Vec<u8> ⓘ
Canonical payload to sign for the signature field.
Sourcepub fn to_base64_uri(&self) -> Result<String, Error>
pub fn to_base64_uri(&self) -> Result<String, Error>
Encode as pop-ref:<base64url> URI.
Sourcepub fn from_base64_uri(uri: &str) -> Result<Self, CompactRefError>
pub fn from_base64_uri(uri: &str) -> Result<Self, CompactRefError>
Decode from pop-ref:<base64url> URI.
Sourcepub fn verification_uri(&self) -> String
pub fn verification_uri(&self) -> String
pop://verify?... URI for the verification service.
Sourcepub fn estimated_size(&self) -> usize
pub fn estimated_size(&self) -> usize
Rough estimate of encoded size in bytes.
Trait Implementations§
Source§impl Clone for CompactEvidenceRef
impl Clone for CompactEvidenceRef
Source§fn clone(&self) -> CompactEvidenceRef
fn clone(&self) -> CompactEvidenceRef
Returns a duplicate of the value. Read more
1.0.0 · 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 CompactEvidenceRef
impl Debug for CompactEvidenceRef
Source§impl<'de> Deserialize<'de> for CompactEvidenceRef
impl<'de> Deserialize<'de> for CompactEvidenceRef
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for CompactEvidenceRef
impl RefUnwindSafe for CompactEvidenceRef
impl Send for CompactEvidenceRef
impl Sync for CompactEvidenceRef
impl Unpin for CompactEvidenceRef
impl UnsafeUnpin for CompactEvidenceRef
impl UnwindSafe for CompactEvidenceRef
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