Skip to main content

RecordEnvelope

Struct RecordEnvelope 

Source
pub struct RecordEnvelope { /* private fields */ }
Expand description

Versioned durable session-record envelope.

Implementations§

Source§

impl RecordEnvelope

Source

pub fn new( record_id: RecordId, session_id: SessionId, sequence: SessionSequence, timestamp: ProtocolTimestamp, causation_id: Option<CausationId>, correlation_id: Option<CorrelationId>, branch_id: Option<BranchId>, metadata: ProtocolMetadata, record: SessionRecord, ) -> Result<Self, RecordValidationError>

Creates a validated current-version durable record envelope.

§Errors

Returns an error when the record payload or branch references are invalid.

Source

pub fn decode_value(value: Value) -> Result<Self, RecordDecodeError>

Decodes untrusted JSON while preserving unsupported-record classification.

§Errors

Returns RecordDecodeError::UnsupportedType for an unknown canonical discriminator and RecordDecodeError::Invalid for malformed data.

Source

pub const fn protocol_version(&self) -> ProtocolVersion

Returns the protocol version.

Source

pub const fn record_id(&self) -> RecordId

Returns the record identifier.

Source

pub const fn session_id(&self) -> SessionId

Returns the owning session.

Source

pub const fn sequence(&self) -> SessionSequence

Returns the authoritative replay sequence.

Source

pub const fn timestamp(&self) -> ProtocolTimestamp

Returns the record timestamp.

Source

pub const fn causation_id(&self) -> Option<CausationId>

Returns the optional immediate cause.

Source

pub const fn correlation_id(&self) -> Option<CorrelationId>

Returns the optional operation correlation identifier.

Source

pub const fn branch_id(&self) -> Option<BranchId>

Returns the branch receiving this fact when branch-scoped.

Source

pub const fn metadata(&self) -> &ProtocolMetadata

Returns bounded extension metadata.

Source

pub const fn record(&self) -> &SessionRecord

Returns the typed durable fact.

Source

pub const fn record_type(&self) -> SessionRecordType

Returns the stable durable record discriminator.

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

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

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

Source§

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 PartialEq for RecordEnvelope

Source§

fn eq(&self, other: &RecordEnvelope) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for RecordEnvelope

Source§

fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for RecordEnvelope

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
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.

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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.