pub struct TransactionEnvelope {
pub envelope_id: EnvelopeId,
pub transaction_id: String,
pub operations: Vec<Operation>,
pub consistency_contract: ConsistencyContract,
pub originating_node: String,
pub vector_clock: VectorClock,
pub timestamp_ms: u64,
}Expand description
Atomic unit for multi-replica delivery Prevents partial delivery of multi-operation transactions
Fields§
§envelope_id: EnvelopeId§transaction_id: String§operations: Vec<Operation>§consistency_contract: ConsistencyContract§originating_node: String§vector_clock: VectorClock§timestamp_ms: u64Implementations§
Source§impl TransactionEnvelope
impl TransactionEnvelope
pub fn new( originating_node: String, sequence: u64, transaction_id: String, operations: Vec<Operation>, consistency_contract: ConsistencyContract, ) -> Self
Sourcepub fn advance_clock(&mut self, replica_clock: &VectorClock)
pub fn advance_clock(&mut self, replica_clock: &VectorClock)
Advance vector clock to account for replication delay
Sourcepub fn verify_integrity(&self) -> bool
pub fn verify_integrity(&self) -> bool
Verify envelope integrity (all operations present)
Trait Implementations§
Source§impl Clone for TransactionEnvelope
impl Clone for TransactionEnvelope
Source§impl Debug for TransactionEnvelope
impl Debug for TransactionEnvelope
Source§impl<'de> Deserialize<'de> for TransactionEnvelope
impl<'de> Deserialize<'de> for TransactionEnvelope
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 TransactionEnvelope
impl RefUnwindSafe for TransactionEnvelope
impl Send for TransactionEnvelope
impl Sync for TransactionEnvelope
impl Unpin for TransactionEnvelope
impl UnsafeUnpin for TransactionEnvelope
impl UnwindSafe for TransactionEnvelope
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