Versionize

Trait Versionize 

Source
pub trait Versionize {
    type Versioned<'vers>: Serialize
       where Self: 'vers;

    // Required method
    fn versionize(&self) -> Self::Versioned<'_>;
}
Expand description

This trait means that the type can be converted into a versioned equivalent type.

Required Associated Types§

Source

type Versioned<'vers>: Serialize where Self: 'vers

The equivalent versioned type. It should have a variant for each version. It may own the underlying data or only hold a read-only reference to it.

Required Methods§

Source

fn versionize(&self) -> Self::Versioned<'_>

Wraps the object into a versioned enum with a variant for each version. This will use references on the underlying types if possible.

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 Versionize for bool

Source§

type Versioned<'vers> = bool

Source§

fn versionize(&self) -> Self::Versioned<'_>

Source§

impl Versionize for char

Source§

type Versioned<'vers> = char

Source§

fn versionize(&self) -> Self::Versioned<'_>

Source§

impl Versionize for f32

Source§

type Versioned<'vers> = f32

Source§

fn versionize(&self) -> Self::Versioned<'_>

Source§

impl Versionize for f64

Source§

type Versioned<'vers> = f64

Source§

fn versionize(&self) -> Self::Versioned<'_>

Source§

impl Versionize for i8

Source§

type Versioned<'vers> = i8

Source§

fn versionize(&self) -> Self::Versioned<'_>

Source§

impl Versionize for i16

Source§

type Versioned<'vers> = i16

Source§

fn versionize(&self) -> Self::Versioned<'_>

Source§

impl Versionize for i32

Source§

type Versioned<'vers> = i32

Source§

fn versionize(&self) -> Self::Versioned<'_>

Source§

impl Versionize for i64

Source§

type Versioned<'vers> = i64

Source§

fn versionize(&self) -> Self::Versioned<'_>

Source§

impl Versionize for i128

Source§

type Versioned<'vers> = i128

Source§

fn versionize(&self) -> Self::Versioned<'_>

Source§

impl Versionize for str

Source§

type Versioned<'vers> = &'vers str

Source§

fn versionize(&self) -> Self::Versioned<'_>

Source§

impl Versionize for u8

Source§

type Versioned<'vers> = u8

Source§

fn versionize(&self) -> Self::Versioned<'_>

Source§

impl Versionize for u16

Source§

type Versioned<'vers> = u16

Source§

fn versionize(&self) -> Self::Versioned<'_>

Source§

impl Versionize for u32

Source§

type Versioned<'vers> = u32

Source§

fn versionize(&self) -> Self::Versioned<'_>

Source§

impl Versionize for u64

Source§

type Versioned<'vers> = u64

Source§

fn versionize(&self) -> Self::Versioned<'_>

Source§

impl Versionize for u128

Source§

type Versioned<'vers> = u128

Source§

fn versionize(&self) -> Self::Versioned<'_>

Source§

impl Versionize for ()

Source§

type Versioned<'vers> = ()

Source§

fn versionize(&self) -> Self::Versioned<'_>

Source§

impl Versionize for usize

Source§

type Versioned<'vers> = usize

Source§

fn versionize(&self) -> Self::Versioned<'_>

Source§

impl Versionize for String

Source§

type Versioned<'vers> = &'vers str

Source§

fn versionize(&self) -> Self::Versioned<'_>

Source§

impl Versionize for NonZero<u32>

Source§

type Versioned<'vers> = NonZero<u32>

Source§

fn versionize(&self) -> Self::Versioned<'_>

Source§

impl Versionize for NonZero<usize>

Source§

type Versioned<'vers> = NonZero<usize>

Source§

fn versionize(&self) -> Self::Versioned<'_>

Source§

impl<K: Versionize, V: Versionize> Versionize for BTreeMap<K, V>

Source§

type Versioned<'vers> = Vec<(<K as Versionize>::Versioned<'vers>, <V as Versionize>::Versioned<'vers>)> where K: 'vers, V: 'vers

Source§

fn versionize(&self) -> Self::Versioned<'_>

Source§

impl<K: Versionize, V: Versionize> Versionize for HashMap<K, V>

Source§

type Versioned<'vers> = Vec<(<K as Versionize>::Versioned<'vers>, <V as Versionize>::Versioned<'vers>)> where K: 'vers, V: 'vers

Source§

fn versionize(&self) -> Self::Versioned<'_>

Source§

impl<T> Versionize for PhantomData<T>

Source§

type Versioned<'vers> = PhantomData<T> where Self: 'vers

Source§

fn versionize(&self) -> Self::Versioned<'_>

Source§

impl<T: Versionize> Versionize for Option<T>

Source§

type Versioned<'vers> = Option<<T as Versionize>::Versioned<'vers>> where T: 'vers

Source§

fn versionize(&self) -> Self::Versioned<'_>

Source§

impl<T: Versionize> Versionize for Box<T>

Source§

type Versioned<'vers> = <T as Versionize>::Versioned<'vers> where T: 'vers

Source§

fn versionize(&self) -> Self::Versioned<'_>

Source§

impl<T: Versionize> Versionize for BTreeSet<T>

Source§

type Versioned<'vers> = Vec<<T as Versionize>::Versioned<'vers>> where T: 'vers

Source§

fn versionize(&self) -> Self::Versioned<'_>

Source§

impl<T: Versionize> Versionize for Arc<T>

Source§

type Versioned<'vers> = <T as Versionize>::Versioned<'vers> where T: 'vers

Source§

fn versionize(&self) -> Self::Versioned<'_>

Source§

impl<T: Versionize> Versionize for Wrapping<T>

Source§

type Versioned<'vers> = Wrapping<<T as Versionize>::Versioned<'vers>> where T: 'vers

Source§

fn versionize(&self) -> Self::Versioned<'_>

Source§

impl<T: Versionize> Versionize for HashSet<T>

Source§

type Versioned<'vers> = Vec<<T as Versionize>::Versioned<'vers>> where T: 'vers

Source§

fn versionize(&self) -> Self::Versioned<'_>

Source§

impl<T: Versionize> Versionize for ABox<T>

Source§

type Versioned<'vers> = <T as Versionize>::Versioned<'vers> where T: 'vers

Source§

fn versionize(&self) -> Self::Versioned<'_>

Source§

impl<T: Versionize> Versionize for Complex<T>

Source§

type Versioned<'vers> = Complex<<T as Versionize>::Versioned<'vers>> where T: 'vers

Source§

fn versionize(&self) -> Self::Versioned<'_>

Source§

impl<T: Versionize, U: Versionize> Versionize for (T, U)

Source§

type Versioned<'vers> = (<T as Versionize>::Versioned<'vers>, <U as Versionize>::Versioned<'vers>) where T: 'vers, U: 'vers

Source§

fn versionize(&self) -> Self::Versioned<'_>

Source§

impl<T: Versionize, U: Versionize, V: Versionize> Versionize for (T, U, V)

Source§

type Versioned<'vers> = (<T as Versionize>::Versioned<'vers>, <U as Versionize>::Versioned<'vers>, <V as Versionize>::Versioned<'vers>) where T: 'vers, U: 'vers, V: 'vers

Source§

fn versionize(&self) -> Self::Versioned<'_>

Source§

impl<T: VersionizeSlice + Clone> Versionize for [T]

Source§

type Versioned<'vers> = <T as VersionizeSlice>::VersionedSlice<'vers> where T: 'vers

Source§

fn versionize(&self) -> Self::Versioned<'_>

Source§

impl<T: VersionizeSlice + Clone> Versionize for Box<[T]>

Source§

type Versioned<'vers> = <T as VersionizeSlice>::VersionedSlice<'vers> where T: 'vers

Source§

fn versionize(&self) -> Self::Versioned<'_>

Source§

impl<T: VersionizeSlice + Clone> Versionize for ABox<[T]>

Source§

type Versioned<'vers> = <T as VersionizeSlice>::VersionedSlice<'vers> where T: 'vers

Source§

fn versionize(&self) -> Self::Versioned<'_>

Source§

impl<T: VersionizeSlice> Versionize for Vec<T>

Source§

type Versioned<'vers> = <T as VersionizeSlice>::VersionedSlice<'vers> where T: 'vers

Source§

fn versionize(&self) -> Self::Versioned<'_>

Source§

impl<T: VersionizeSlice> Versionize for AVec<T>

Source§

type Versioned<'vers> = <T as VersionizeSlice>::VersionedSlice<'vers> where T: 'vers

Source§

fn versionize(&self) -> Self::Versioned<'_>

Source§

impl<const N: usize, T: VersionizeSlice> Versionize for [T; N]

Source§

type Versioned<'vers> = <T as VersionizeSlice>::VersionedSlice<'vers> where T: 'vers

Source§

fn versionize(&self) -> Self::Versioned<'_>

Implementors§