pub struct TransactionIdentity {
pub transaction_id: TransactionId,
pub external_id: Option<ExternalId>,
pub random_id: RandomId,
pub temporary_message_id: Option<InlineId>,
pub final_message_id: Option<InlineId>,
}Expand description
Identity data used to reconcile a mutation across host, client, and server.
Fields§
§transaction_id: TransactionIdStable client transaction ID.
external_id: Option<ExternalId>Optional host-provided idempotency key.
random_id: RandomIdInline mutation random ID.
temporary_message_id: Option<InlineId>Temporary local message ID, when the mutation created one.
final_message_id: Option<InlineId>Final server message ID, when known.
Implementations§
Source§impl TransactionIdentity
impl TransactionIdentity
Sourcepub fn new(
transaction_id: TransactionId,
external_id: Option<ExternalId>,
random_id: RandomId,
) -> Self
pub fn new( transaction_id: TransactionId, external_id: Option<ExternalId>, random_id: RandomId, ) -> Self
Creates a transaction identity before a temporary or final message ID is known.
Sourcepub fn with_temporary_message_id(self, message_id: impl Into<InlineId>) -> Self
pub fn with_temporary_message_id(self, message_id: impl Into<InlineId>) -> Self
Records the temporary message ID assigned by optimistic local state.
Sourcepub fn with_final_message_id(self, message_id: impl Into<InlineId>) -> Self
pub fn with_final_message_id(self, message_id: impl Into<InlineId>) -> Self
Records the final server message ID.
Trait Implementations§
Source§impl Clone for TransactionIdentity
impl Clone for TransactionIdentity
Source§fn clone(&self) -> TransactionIdentity
fn clone(&self) -> TransactionIdentity
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 TransactionIdentity
impl Debug for TransactionIdentity
Source§impl<'de> Deserialize<'de> for TransactionIdentity
impl<'de> Deserialize<'de> for TransactionIdentity
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
impl Eq for TransactionIdentity
Source§impl PartialEq for TransactionIdentity
impl PartialEq for TransactionIdentity
Source§impl Serialize for TransactionIdentity
impl Serialize for TransactionIdentity
impl StructuralPartialEq for TransactionIdentity
Auto Trait Implementations§
impl Freeze for TransactionIdentity
impl RefUnwindSafe for TransactionIdentity
impl Send for TransactionIdentity
impl Sync for TransactionIdentity
impl Unpin for TransactionIdentity
impl UnsafeUnpin for TransactionIdentity
impl UnwindSafe for TransactionIdentity
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