Skip to main content

Versioned

Trait Versioned 

Source
pub trait Versioned: Sized {
    const CURRENT_VERSION: u8;
    const CRDT_TYPE: CrdtType;
}
Expand description

Trait for CRDT types that support versioned serialization.

Types implementing this trait can be serialized with a 3-byte version envelope, enabling automatic migration when data schemas change.

Required Associated Constants§

Source

const CURRENT_VERSION: u8

Current schema version for this CRDT type’s serialization format.

Source

const CRDT_TYPE: CrdtType

The CRDT type identifier for the envelope.

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.

Implementors§

Source§

impl Versioned for GCounter

Source§

const CURRENT_VERSION: u8 = 1

Source§

const CRDT_TYPE: CrdtType = CrdtType::GCounter

Source§

impl Versioned for PNCounter

Source§

const CURRENT_VERSION: u8 = 1

Source§

const CRDT_TYPE: CrdtType = CrdtType::PNCounter

Source§

impl Versioned for TextCrdt

Source§

const CURRENT_VERSION: u8 = 1

Source§

const CRDT_TYPE: CrdtType = CrdtType::TextCrdt

Source§

impl<K: Ord + Clone, V: Clone + Eq> Versioned for AWMap<K, V>

Source§

const CURRENT_VERSION: u8 = 1

Source§

const CRDT_TYPE: CrdtType = CrdtType::AWMap

Source§

impl<K: Ord + Clone, V: Clone> Versioned for LWWMap<K, V>

Source§

const CURRENT_VERSION: u8 = 1

Source§

const CRDT_TYPE: CrdtType = CrdtType::LWWMap

Source§

impl<T: Clone + Ord> Versioned for Rga<T>

Source§

const CURRENT_VERSION: u8 = 1

Source§

const CRDT_TYPE: CrdtType = CrdtType::Rga

Source§

impl<T: Clone + Ord> Versioned for MVRegister<T>

Source§

const CURRENT_VERSION: u8 = 1

Source§

const CRDT_TYPE: CrdtType = CrdtType::MVRegister

Source§

impl<T: Clone> Versioned for LWWRegister<T>

Source§

const CURRENT_VERSION: u8 = 1

Source§

const CRDT_TYPE: CrdtType = CrdtType::LWWRegister

Source§

impl<T: Ord + Clone> Versioned for GSet<T>

Source§

const CURRENT_VERSION: u8 = 1

Source§

const CRDT_TYPE: CrdtType = CrdtType::GSet

Source§

impl<T: Ord + Clone> Versioned for ORSet<T>

Source§

const CURRENT_VERSION: u8 = 1

Source§

const CRDT_TYPE: CrdtType = CrdtType::ORSet

Source§

impl<T: Ord + Clone> Versioned for TwoPSet<T>

Source§

const CURRENT_VERSION: u8 = 1

Source§

const CRDT_TYPE: CrdtType = CrdtType::TwoPSet