Unversionize

Trait Unversionize 

Source
pub trait Unversionize: VersionizeOwned + Sized {
    // Required method
    fn unversionize(
        versioned: Self::VersionedOwned,
    ) -> Result<Self, UnversionizeError>;
}
Expand description

This trait means that we can convert from a versioned enum into the target type.

This trait can only be implemented on Owned/static types, whereas Versionize can also be implemented on reference types.

Required Methods§

Source

fn unversionize( versioned: Self::VersionedOwned, ) -> Result<Self, UnversionizeError>

Creates an object from a versioned enum, and eventually upgrades from previous variants.

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

Source§

impl Unversionize for char

Source§

impl Unversionize for f32

Source§

impl Unversionize for f64

Source§

impl Unversionize for i8

Source§

impl Unversionize for i16

Source§

impl Unversionize for i32

Source§

impl Unversionize for i64

Source§

impl Unversionize for i128

Source§

impl Unversionize for u8

Source§

impl Unversionize for u16

Source§

impl Unversionize for u32

Source§

impl Unversionize for u64

Source§

impl Unversionize for u128

Source§

impl Unversionize for ()

Source§

fn unversionize( _versioned: Self::VersionedOwned, ) -> Result<Self, UnversionizeError>

Source§

impl Unversionize for usize

Source§

impl Unversionize for String

Source§

impl Unversionize for NonZero<u32>

Source§

impl Unversionize for NonZero<usize>

Source§

impl<K: Unversionize + Ord, V: Unversionize> Unversionize for BTreeMap<K, V>

Source§

impl<K: Unversionize + Hash + Eq, V: Unversionize> Unversionize for HashMap<K, V>

Source§

impl<T> Unversionize for PhantomData<T>

Source§

impl<T: Unversionize + Clone> Unversionize for Arc<T>

Source§

impl<T: Unversionize + Clone> Unversionize for ABox<T>

Source§

impl<T: Unversionize + Ord> Unversionize for BTreeSet<T>

Source§

impl<T: Unversionize + Hash + Eq> Unversionize for HashSet<T>

Source§

impl<T: Unversionize> Unversionize for Option<T>

Source§

impl<T: Unversionize> Unversionize for Box<T>

Source§

impl<T: Unversionize> Unversionize for Wrapping<T>

Source§

impl<T: Unversionize> Unversionize for Complex<T>

Source§

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

Source§

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

Source§

impl<T: UnversionizeVec + Clone> Unversionize for Box<[T]>

Source§

impl<T: UnversionizeVec + Clone> Unversionize for ABox<[T]>

Source§

impl<T: UnversionizeVec + Clone> Unversionize for AVec<T>

Source§

impl<T: UnversionizeVec> Unversionize for Vec<T>

Source§

impl<const N: usize, T: UnversionizeVec + Clone> Unversionize for [T; N]

Implementors§