pub struct RecordEnvelope { /* private fields */ }Expand description
Versioned durable session-record envelope.
Implementations§
Source§impl RecordEnvelope
impl RecordEnvelope
Sourcepub 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>
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.
Sourcepub fn decode_value(value: Value) -> Result<Self, RecordDecodeError>
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.
Sourcepub const fn protocol_version(&self) -> ProtocolVersion
pub const fn protocol_version(&self) -> ProtocolVersion
Returns the protocol version.
Sourcepub const fn session_id(&self) -> SessionId
pub const fn session_id(&self) -> SessionId
Returns the owning session.
Sourcepub const fn sequence(&self) -> SessionSequence
pub const fn sequence(&self) -> SessionSequence
Returns the authoritative replay sequence.
Sourcepub const fn timestamp(&self) -> ProtocolTimestamp
pub const fn timestamp(&self) -> ProtocolTimestamp
Returns the record timestamp.
Sourcepub const fn causation_id(&self) -> Option<CausationId>
pub const fn causation_id(&self) -> Option<CausationId>
Returns the optional immediate cause.
Sourcepub const fn correlation_id(&self) -> Option<CorrelationId>
pub const fn correlation_id(&self) -> Option<CorrelationId>
Returns the optional operation correlation identifier.
Sourcepub const fn branch_id(&self) -> Option<BranchId>
pub const fn branch_id(&self) -> Option<BranchId>
Returns the branch receiving this fact when branch-scoped.
Sourcepub const fn metadata(&self) -> &ProtocolMetadata
pub const fn metadata(&self) -> &ProtocolMetadata
Returns bounded extension metadata.
Sourcepub const fn record(&self) -> &SessionRecord
pub const fn record(&self) -> &SessionRecord
Returns the typed durable fact.
Sourcepub const fn record_type(&self) -> SessionRecordType
pub const fn record_type(&self) -> SessionRecordType
Returns the stable durable record discriminator.
Trait Implementations§
Source§impl Clone for RecordEnvelope
impl Clone for RecordEnvelope
Source§fn clone(&self) -> RecordEnvelope
fn clone(&self) -> RecordEnvelope
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more