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§

source

fn is_empty(&self) -> bool

source

fn compose(&mut self, other: &Self, type_pair: (DeltaType, DeltaType))

this is used when composing two DeltaItems with the same length

source

fn is_mergeable(&self, other: &Self) -> bool

source

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§

source

fn empty() -> Self

source

fn take(&mut self, other: &Self) -> Self

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl Meta for ()

source§

fn empty() -> Self

source§

fn is_empty(&self) -> bool

source§

fn compose(&mut self, _other: &Self, _type_pair: (DeltaType, DeltaType))

source§

fn is_mergeable(&self, _other: &Self) -> bool

source§

fn merge(&mut self, _other: &Self)

Implementors§