Skip to main content

RecordEnvelope

Struct RecordEnvelope 

Source
pub struct RecordEnvelope {
Show 16 fields pub id: String, pub owner_did: String, pub author_did: String, pub proxy_did: Option<String>, pub epistemic_status: EpistemicStatus, pub evidence_type: EvidenceType, pub sensitivity: SensitivityClass, pub asserted_time_unix: u32, pub asserted_instant: Option<InstantBridge>, pub valid_time_start_unix: Option<u32>, pub valid_time_start_instant: Option<InstantBridge>, pub valid_time_end_unix: Option<u32>, pub valid_time_end_instant: Option<InstantBridge>, pub predecessor_id: Option<String>, pub blob_hash: Option<String>, pub tombstone: bool,
}
Expand description

A deterministic Record Envelope

Fields§

§id: String§owner_did: String§author_did: String§proxy_did: Option<String>§epistemic_status: EpistemicStatus§evidence_type: EvidenceType§sensitivity: SensitivityClass§asserted_time_unix: u32§asserted_instant: Option<InstantBridge>

High-resolution instant (T71 bridge). Preferred over asserted_time_unix when present; the u32 field is kept for backward-compatible deserialization.

§valid_time_start_unix: Option<u32>§valid_time_start_instant: Option<InstantBridge>

High-resolution valid-time start (T71 bridge). Preferred over valid_time_start_unix when present.

§valid_time_end_unix: Option<u32>§valid_time_end_instant: Option<InstantBridge>

High-resolution valid-time end (T71 bridge). Preferred over valid_time_end_unix when present.

§predecessor_id: Option<String>§blob_hash: Option<String>§tombstone: bool

Implementations§

Source§

impl RecordEnvelope

Source

pub fn compile_to_quins(&self, out: &mut [NQuin]) -> usize

Zero-allocation compiler: writes the envelope Quins into the provided slice. Returns the number of Quins written.

Source

pub fn asserted_instant(&self) -> InstantBridge

Resolve the asserted instant, preferring the high-resolution InstantBridge field when present and falling back to the coarse u32 Unix seconds otherwise (T71 bridge).

Source

pub fn valid_time_start_instant(&self) -> Option<InstantBridge>

Resolve the valid-time start instant, preferring the high-resolution InstantBridge field when present and falling back to the coarse u32 Unix seconds otherwise (T71 bridge).

Source

pub fn valid_time_end_instant(&self) -> Option<InstantBridge>

Resolve the valid-time end instant, preferring the high-resolution InstantBridge field when present and falling back to the coarse u32 Unix seconds otherwise (T71 bridge).

Source

pub fn with_asserted_instant( id: &str, owner_did: &str, author_did: &str, epistemic_status: EpistemicStatus, evidence_type: EvidenceType, sensitivity: SensitivityClass, asserted: &InstantBridge, blob_hash: Option<String>, ) -> RecordEnvelope

Create a RecordEnvelope with an InstantBridge for asserted time (T71 bridge).

Source

pub fn with_instants( id: &str, owner_did: &str, author_did: &str, epistemic_status: EpistemicStatus, evidence_type: EvidenceType, sensitivity: SensitivityClass, asserted: &InstantBridge, valid_start: Option<&InstantBridge>, valid_end: Option<&InstantBridge>, blob_hash: Option<String>, ) -> RecordEnvelope

Create a RecordEnvelope with InstantBridges for asserted and valid time (T71 bridge).

Source

pub fn valid_time_duration(&self) -> Option<DurationBridge>

The duration of the valid time window (T71 bridge).

Trait Implementations§

Source§

impl Clone for RecordEnvelope

Source§

fn clone(&self) -> RecordEnvelope

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for RecordEnvelope

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for RecordEnvelope

Source§

fn deserialize<__D>( __deserializer: __D, ) -> Result<RecordEnvelope, <__D as Deserializer<'de>>::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for RecordEnvelope

Source§

fn serialize<__S>( &self, __serializer: __S, ) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.