tfhe_versionable/
derived_traits.rs1use serde::de::DeserializeOwned;
5use serde::Serialize;
6
7use crate::UnversionizeError;
8
9pub trait Version: Sized {
11 type Ref<'vers>: From<&'vers Self> + Serialize
12 where
13 Self: 'vers;
14 type Owned: From<Self> + TryInto<Self, Error = UnversionizeError> + DeserializeOwned + Serialize;
15}
16
17pub trait VersionsDispatch<Unversioned>: Sized {
21 type Ref<'vers>: From<&'vers Unversioned> + Serialize
22 where
23 Unversioned: 'vers;
24 type Owned: From<Unversioned>
25 + TryInto<Unversioned, Error = UnversionizeError>
26 + DeserializeOwned
27 + Serialize;
28}