Trait loro_internal::delta::Meta
source · pub trait Meta: Debug + Clone + PartialEq + Default {
// Required methods
fn is_empty(&self) -> bool;
fn compose(&mut self, other: &Self, type_pair: (DeltaType, DeltaType));
fn is_mergeable(&self, other: &Self) -> bool;
fn merge(&mut self, other: &Self);
// Provided methods
fn empty() -> Self { ... }
fn take(&mut self, other: &Self) -> Self { ... }
}Expand description
The metadata of a DeltaItem If empty metadata is used to override the older one, we will remove the metadata into None
Required Methods§
fn is_empty(&self) -> bool
sourcefn compose(&mut self, other: &Self, type_pair: (DeltaType, DeltaType))
fn compose(&mut self, other: &Self, type_pair: (DeltaType, DeltaType))
this is used when composing two DeltaItems with the same length
fn is_mergeable(&self, other: &Self) -> bool
sourcefn merge(&mut self, other: &Self)
fn merge(&mut self, other: &Self)
This is used when we merge two DeltaItems. And it’s guaranteed that Meta::is_mergeable is true
Provided Methods§
Object Safety§
This trait is not object safe.