pub struct ChangeEnvelope { /* private fields */ }Expand description
Canonical sync event stored in the journal and passed to planners.
Implementations§
Source§impl ChangeEnvelope
impl ChangeEnvelope
Sourcepub const fn new(
sync_key: SyncKey,
source: SourceSystem,
operation: ChangeOperation,
observed_at: DateTime<Utc>,
payload: Value,
) -> Self
pub const fn new( sync_key: SyncKey, source: SourceSystem, operation: ChangeOperation, observed_at: DateTime<Utc>, payload: Value, ) -> Self
Creates a new change envelope with no replay cursor.
Sourcepub fn with_cursor(self, cursor: SourceCursor) -> Self
pub fn with_cursor(self, cursor: SourceCursor) -> Self
Attaches a replay cursor to the envelope.
Sourcepub const fn source(&self) -> SourceSystem
pub const fn source(&self) -> SourceSystem
Returns the source system for the change.
Sourcepub const fn operation(&self) -> ChangeOperation
pub const fn operation(&self) -> ChangeOperation
Returns the operation carried by the change.
Sourcepub const fn cursor(&self) -> Option<&SourceCursor>
pub const fn cursor(&self) -> Option<&SourceCursor>
Returns the source cursor, if available.
Sourcepub const fn observed_at(&self) -> DateTime<Utc>
pub const fn observed_at(&self) -> DateTime<Utc>
Returns when the change was observed by the sync engine.
Sourcepub fn payload_hash(&self) -> [u8; 32]
pub fn payload_hash(&self) -> [u8; 32]
Returns a stable hash for the payload contents.
Sourcepub fn payload_hash_matches(&self, other: &Value) -> bool
pub fn payload_hash_matches(&self, other: &Value) -> bool
Returns true when the provided payload hashes to the same value.
Trait Implementations§
Source§impl Clone for ChangeEnvelope
impl Clone for ChangeEnvelope
Source§fn clone(&self) -> ChangeEnvelope
fn clone(&self) -> ChangeEnvelope
Returns a duplicate of the value. Read more
1.0.0 · 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 ChangeEnvelope
impl Debug for ChangeEnvelope
Source§impl PartialEq for ChangeEnvelope
impl PartialEq for ChangeEnvelope
impl Eq for ChangeEnvelope
impl StructuralPartialEq for ChangeEnvelope
Auto Trait Implementations§
impl Freeze for ChangeEnvelope
impl RefUnwindSafe for ChangeEnvelope
impl Send for ChangeEnvelope
impl Sync for ChangeEnvelope
impl Unpin for ChangeEnvelope
impl UnsafeUnpin for ChangeEnvelope
impl UnwindSafe for ChangeEnvelope
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request