Meta

Trait 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

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so 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§