pub struct ProvenanceMark { /* private fields */ }Implementations§
Source§impl ProvenanceMark
impl ProvenanceMark
Sourcepub fn validate(marks: Vec<ProvenanceMark>) -> ValidationReport
pub fn validate(marks: Vec<ProvenanceMark>) -> ValidationReport
Validate a collection of provenance marks
This method analyzes the provided marks and produces a comprehensive validation report that includes:
- Deduplication of exact duplicates
- Organization by chain ID
- Detection of genesis marks
- Identification of contiguous sequences
- Flagging of validation issues (hash mismatches, sequence gaps, etc.)
Source§impl ProvenanceMark
impl ProvenanceMark
pub fn res(&self) -> ProvenanceMarkResolution
pub fn key(&self) -> &[u8] ⓘ
pub fn hash(&self) -> &[u8] ⓘ
pub fn chain_id(&self) -> &[u8] ⓘ
pub fn seq_bytes(&self) -> &[u8] ⓘ
pub fn date_bytes(&self) -> &[u8] ⓘ
pub fn seq(&self) -> u32
pub fn date(&self) -> Date
pub fn message(&self) -> Vec<u8> ⓘ
pub fn info(&self) -> Option<CBOR>
Source§impl ProvenanceMark
impl ProvenanceMark
pub fn new( res: ProvenanceMarkResolution, key: Vec<u8>, next_key: Vec<u8>, chain_id: Vec<u8>, seq: u32, date: Date, info: Option<impl CBOREncodable>, ) -> Result<Self>
pub fn from_message( res: ProvenanceMarkResolution, message: Vec<u8>, ) -> Result<Self>
Source§impl ProvenanceMark
impl ProvenanceMark
Sourcepub fn identifier(&self) -> String
pub fn identifier(&self) -> String
The first four bytes of the mark’s hash as a hex string.
Sourcepub fn bytewords_identifier(&self, prefix: bool) -> String
pub fn bytewords_identifier(&self, prefix: bool) -> String
The first four bytes of the mark’s hash as upper-case ByteWords.
Sourcepub fn bytemoji_identifier(&self, prefix: bool) -> String
pub fn bytemoji_identifier(&self, prefix: bool) -> String
The first four bytes of the mark’s hash as Bytemoji.
Sourcepub fn bytewords_minimal_identifier(&self, prefix: bool) -> String
pub fn bytewords_minimal_identifier(&self, prefix: bool) -> String
A compact 8-letter identifier derived from the upper-case ByteWords identifier by taking the first and last letter of each ByteWords word (4 words × 2 letters = 8 letters).
Source§impl ProvenanceMark
impl ProvenanceMark
pub fn precedes(&self, next: &ProvenanceMark) -> bool
pub fn precedes_opt(&self, next: &ProvenanceMark) -> Result<()>
pub fn is_sequence_valid(marks: &[ProvenanceMark]) -> bool
pub fn is_genesis(&self) -> bool
Source§impl ProvenanceMark
impl ProvenanceMark
pub fn to_bytewords_with_style(&self, style: Style) -> String
pub fn to_bytewords(&self) -> String
pub fn from_bytewords( res: ProvenanceMarkResolution, bytewords: &str, ) -> Result<Self>
Source§impl ProvenanceMark
impl ProvenanceMark
pub fn to_url_encoding(&self) -> String
pub fn from_url_encoding(url_encoding: &str) -> Result<Self>
Source§impl ProvenanceMark
impl ProvenanceMark
pub fn fingerprint(&self) -> [u8; 32]
Trait Implementations§
Source§impl CBORTagged for ProvenanceMark
impl CBORTagged for ProvenanceMark
Returns the CBOR tags associated with this type. Read more
Source§impl CBORTaggedDecodable for ProvenanceMark
impl CBORTaggedDecodable for ProvenanceMark
Source§fn from_untagged_cbor(cbor: CBOR) -> Result<Self>
fn from_untagged_cbor(cbor: CBOR) -> Result<Self>
Creates an instance of this type by decoding it from untagged CBOR. Read more
Source§fn from_tagged_cbor(cbor: CBOR) -> Result<Self, Error>where
Self: Sized,
fn from_tagged_cbor(cbor: CBOR) -> Result<Self, Error>where
Self: Sized,
Creates an instance of this type by decoding it from tagged CBOR. Read more
Source§impl CBORTaggedEncodable for ProvenanceMark
impl CBORTaggedEncodable for ProvenanceMark
Source§fn untagged_cbor(&self) -> CBOR
fn untagged_cbor(&self) -> CBOR
Returns the untagged CBOR encoding of this instance. Read more
Source§fn tagged_cbor(&self) -> CBOR
fn tagged_cbor(&self) -> CBOR
Returns the tagged CBOR encoding of this instance. Read more
Source§impl Clone for ProvenanceMark
impl Clone for ProvenanceMark
Source§fn clone(&self) -> ProvenanceMark
fn clone(&self) -> ProvenanceMark
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 ProvenanceMark
impl Debug for ProvenanceMark
Source§impl<'de> Deserialize<'de> for ProvenanceMark
impl<'de> Deserialize<'de> for ProvenanceMark
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
Source§impl Display for ProvenanceMark
impl Display for ProvenanceMark
Source§impl From<&ProvenanceMark> for ProvenanceMark
impl From<&ProvenanceMark> for ProvenanceMark
Source§fn from(mark: &ProvenanceMark) -> Self
fn from(mark: &ProvenanceMark) -> Self
Converts to this type from the input type.
Source§impl From<ProvenanceMark> for CBOR
impl From<ProvenanceMark> for CBOR
Source§fn from(value: ProvenanceMark) -> Self
fn from(value: ProvenanceMark) -> Self
Converts to this type from the input type.
Source§impl From<ProvenanceMark> for Envelope
Available on crate feature envelope only.
impl From<ProvenanceMark> for Envelope
Available on crate feature
envelope only.Source§fn from(mark: ProvenanceMark) -> Self
fn from(mark: ProvenanceMark) -> Self
Converts to this type from the input type.
Source§impl Hash for ProvenanceMark
impl Hash for ProvenanceMark
Source§impl PartialEq for ProvenanceMark
impl PartialEq for ProvenanceMark
Source§impl Serialize for ProvenanceMark
impl Serialize for ProvenanceMark
Source§impl TryFrom<CBOR> for ProvenanceMark
impl TryFrom<CBOR> for ProvenanceMark
Source§impl TryFrom<Envelope> for ProvenanceMark
Available on crate feature envelope only.
impl TryFrom<Envelope> for ProvenanceMark
Available on crate feature
envelope only.impl Eq for ProvenanceMark
Auto Trait Implementations§
impl Freeze for ProvenanceMark
impl RefUnwindSafe for ProvenanceMark
impl Send for ProvenanceMark
impl Sync for ProvenanceMark
impl Unpin for ProvenanceMark
impl UnwindSafe for ProvenanceMark
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> CBORDecodable for T
impl<T> CBORDecodable for T
Source§impl<T> CBOREncodable for T
impl<T> CBOREncodable for T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> EnvelopeEncodable for T
impl<T> EnvelopeEncodable for T
Source§fn into_envelope(self) -> Envelope
fn into_envelope(self) -> Envelope
Converts the value into an envelope by using its Into<Envelope>
implementation.
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