pub struct ChangeRecord {
pub term: u64,
pub lsn: u64,
pub timestamp: u64,
pub operation: ChangeOperation,
pub collection: String,
pub entity_id: u64,
pub entity_kind: String,
pub entity_bytes: Option<Vec<u8>>,
pub metadata: Option<Value>,
pub refresh_records: Option<Vec<Vec<u8>>>,
}Expand description
Structured logical WAL record serialized into the replication buffer and archived segments.
Fields§
§term: u64§lsn: u64§timestamp: u64§operation: ChangeOperation§collection: String§entity_id: u64§entity_kind: String§entity_bytes: Option<Vec<u8>>§metadata: Option<Value>§refresh_records: Option<Vec<Vec<u8>>>Issue #596 slice 9d — payload for ChangeOperation::Refresh.
Each element is a serialized entity record (the same
serialize_entity_record payload the store’s RefreshCollection
WAL action uses), in the order the replica should bulk_insert
after dropping the prior backing-collection contents.
Implementations§
Source§impl ChangeRecord
impl ChangeRecord
pub fn from_entity( lsn: u64, timestamp: u64, operation: ChangeOperation, collection: impl Into<String>, entity_kind: impl Into<String>, entity: &UnifiedEntity, format_version: u32, metadata: Option<Value>, ) -> ChangeRecord
Sourcepub fn for_refresh(
lsn: u64,
timestamp: u64,
collection: impl Into<String>,
records: Vec<Vec<u8>>,
) -> ChangeRecord
pub fn for_refresh( lsn: u64, timestamp: u64, collection: impl Into<String>, records: Vec<Vec<u8>>, ) -> ChangeRecord
Build a refresh change record carrying the new contents for a
REFRESH MATERIALIZED VIEW replay on the replica. Issue #596
slice 9d.
pub fn to_json_value(&self) -> Value
pub fn encode(&self) -> Vec<u8> ⓘ
pub fn with_term(self, term: u64) -> ChangeRecord
pub fn decode(bytes: &[u8]) -> Result<ChangeRecord, String>
Trait Implementations§
Source§impl Clone for ChangeRecord
impl Clone for ChangeRecord
Source§fn clone(&self) -> ChangeRecord
fn clone(&self) -> ChangeRecord
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 moreAuto Trait Implementations§
impl Freeze for ChangeRecord
impl RefUnwindSafe for ChangeRecord
impl Send for ChangeRecord
impl Sync for ChangeRecord
impl Unpin for ChangeRecord
impl UnsafeUnpin for ChangeRecord
impl UnwindSafe for ChangeRecord
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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<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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§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