pub struct MaterializationEvent {
pub timestamp: DateTime<Utc>,
pub agent: String,
pub from_crdt_format: Option<CrdtFormat>,
pub to_crdt_format: Option<CrdtFormat>,
pub reason: MaterializationReason,
}Expand description
Materialization event for CRDT documents.
When a document with CRDT state is exported or exchanged between different CRDT implementations, it must be materialized to static content.
Fields§
§timestamp: DateTime<Utc>Timestamp of the materialization.
agent: StringTool that performed the materialization.
from_crdt_format: Option<CrdtFormat>Original CRDT format (if applicable).
to_crdt_format: Option<CrdtFormat>Target CRDT format (if applicable).
reason: MaterializationReasonReason for materialization.
Implementations§
Source§impl MaterializationEvent
impl MaterializationEvent
Sourcepub fn new(agent: impl Into<String>, reason: MaterializationReason) -> Self
pub fn new(agent: impl Into<String>, reason: MaterializationReason) -> Self
Create a new materialization event.
Sourcepub fn with_source_format(self, format: CrdtFormat) -> Self
pub fn with_source_format(self, format: CrdtFormat) -> Self
Set the source CRDT format.
Sourcepub fn with_target_format(self, format: CrdtFormat) -> Self
pub fn with_target_format(self, format: CrdtFormat) -> Self
Set the target CRDT format.
Sourcepub fn cross_tool_exchange(
agent: impl Into<String>,
from: CrdtFormat,
to: CrdtFormat,
) -> Self
pub fn cross_tool_exchange( agent: impl Into<String>, from: CrdtFormat, to: CrdtFormat, ) -> Self
Create an event for cross-tool exchange.
Sourcepub fn export(agent: impl Into<String>, from: CrdtFormat) -> Self
pub fn export(agent: impl Into<String>, from: CrdtFormat) -> Self
Create an event for export to static format.
Trait Implementations§
Source§impl Clone for MaterializationEvent
impl Clone for MaterializationEvent
Source§fn clone(&self) -> MaterializationEvent
fn clone(&self) -> MaterializationEvent
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 MaterializationEvent
impl Debug for MaterializationEvent
Source§impl<'de> Deserialize<'de> for MaterializationEvent
impl<'de> Deserialize<'de> for MaterializationEvent
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
Source§impl PartialEq for MaterializationEvent
impl PartialEq for MaterializationEvent
Source§impl Serialize for MaterializationEvent
impl Serialize for MaterializationEvent
impl StructuralPartialEq for MaterializationEvent
Auto Trait Implementations§
impl Freeze for MaterializationEvent
impl RefUnwindSafe for MaterializationEvent
impl Send for MaterializationEvent
impl Sync for MaterializationEvent
impl Unpin for MaterializationEvent
impl UnsafeUnpin for MaterializationEvent
impl UnwindSafe for MaterializationEvent
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