Deprecated

Struct Deprecated 

Source
pub struct Deprecated<T> { /* private fields */ }
Expand description

Wrapper type that can be used inside the dispatch enum for a type to mark a version that has been deprecated.

For example:

use tfhe_versionable::deprecation::{Deprecable, Deprecated};
use tfhe_versionable::{Versionize, VersionsDispatch};
#[derive(Versionize)]
#[versionize(MyStructVersions)]
struct MyStruct;

impl Deprecable for MyStruct {
    const TYPE_NAME: &'static str = "MyStruct";
    const MIN_SUPPORTED_APP_VERSION: &'static str = "my_app v2";
}

#[derive(VersionsDispatch)]
#[allow(unused)]
pub enum MyStructVersions {
    V0(Deprecated<MyStruct>),
    V1(Deprecated<MyStruct>),
    V2(MyStruct),
}

Trait Implementations§

Source§

impl<T: Deprecable> From<&Deprecated<T>> for DeprecatedVersion<T>

Source§

fn from(_value: &Deprecated<T>) -> Self

Converts to this type from the input type.
Source§

impl<T: Deprecable> From<Deprecated<T>> for DeprecatedVersion<T>

Source§

fn from(_value: Deprecated<T>) -> Self

Converts to this type from the input type.
Source§

impl<T: Deprecable> TryFrom<DeprecatedVersion<T>> for Deprecated<T>

Source§

type Error = UnversionizeError

The type returned in the event of a conversion error.
Source§

fn try_from(_value: DeprecatedVersion<T>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<T: Deprecable, U> Upgrade<U> for Deprecated<T>

Source§

impl<T: Deprecable> Version for Deprecated<T>

Source§

type Ref<'vers> = DeprecatedVersion<T> where T: 'vers

Source§

type Owned = DeprecatedVersion<T>

Auto Trait Implementations§

§

impl<T> Freeze for Deprecated<T>

§

impl<T> RefUnwindSafe for Deprecated<T>
where T: RefUnwindSafe,

§

impl<T> Send for Deprecated<T>
where T: Send,

§

impl<T> Sync for Deprecated<T>
where T: Sync,

§

impl<T> Unpin for Deprecated<T>
where T: Unpin,

§

impl<T> UnwindSafe for Deprecated<T>
where T: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.