pub trait FixedTypeId {
const TYPE_NAME: &'static str;
const TYPE_ID: FixedId = _;
const TYPE_VERSION: FixedVersion = _;
// Provided methods
fn ty_name(&self) -> &'static str { ... }
fn ty_id(&self) -> FixedId { ... }
fn ty_version(&self) -> FixedVersion { ... }
}Expand description
A trait for providing a type id number.
Required Associated Constants§
Sourceconst TYPE_NAME: &'static str
const TYPE_NAME: &'static str
The type name defined by the user, more unique and stable name than the core::any::type_name
When enabled feature erase_name, the type name will be a hex string of the hash of the original type name if it’s a primitive type without generic.
Otherwise, it will be the original type name.
You should implement this trait as specific as possible. Because that the generic implement will make your binary size larger.
Provided Associated Constants§
Sourceconst TYPE_ID: FixedId = _
const TYPE_ID: FixedId = _
A unique id for a type.
It’s default use FixedId::from_type_name with Self::TYPE_VERSION as additional parameter.
When you want to define an id without version, you can use FixedId::from_type_name without additional version parameter.
Sourceconst TYPE_VERSION: FixedVersion = _
const TYPE_VERSION: FixedVersion = _
A semver for a type, with out pre release, build meta etc.
Used to check version compatibility. If versions are not compatible, it can be cast to an semver.
Provided Methods§
Sourcefn ty_version(&self) -> FixedVersion
fn ty_version(&self) -> FixedVersion
Returns the version for a type
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 FixedTypeId for Infallible
impl FixedTypeId for Infallible
Source§impl FixedTypeId for bool
impl FixedTypeId for bool
Source§impl FixedTypeId for char
impl FixedTypeId for char
Source§impl FixedTypeId for f32
impl FixedTypeId for f32
Source§impl FixedTypeId for f64
impl FixedTypeId for f64
Source§impl FixedTypeId for i8
impl FixedTypeId for i8
Source§impl FixedTypeId for i16
impl FixedTypeId for i16
Source§impl FixedTypeId for i32
impl FixedTypeId for i32
Source§impl FixedTypeId for i64
impl FixedTypeId for i64
Source§impl FixedTypeId for i128
impl FixedTypeId for i128
Source§impl FixedTypeId for isize
impl FixedTypeId for isize
Source§impl FixedTypeId for str
impl FixedTypeId for str
Source§impl FixedTypeId for u8
impl FixedTypeId for u8
Source§impl FixedTypeId for u16
impl FixedTypeId for u16
Source§impl FixedTypeId for u32
impl FixedTypeId for u32
Source§impl FixedTypeId for u64
impl FixedTypeId for u64
Source§impl FixedTypeId for u128
impl FixedTypeId for u128
Source§impl FixedTypeId for usize
impl FixedTypeId for usize
Source§impl FixedTypeId for String
impl FixedTypeId for String
Source§impl FixedTypeId for RangeFull
impl FixedTypeId for RangeFull
Source§impl FixedTypeId for Duration
impl FixedTypeId for Duration
Source§impl<K: FixedTypeId, V: FixedTypeId> FixedTypeId for BTreeMap<K, V>where
Self: ConstTypeName,
impl<K: FixedTypeId, V: FixedTypeId> FixedTypeId for BTreeMap<K, V>where
Self: ConstTypeName,
Source§impl<K: FixedTypeId, V: FixedTypeId, S> FixedTypeId for HashMap<K, V, S>where
Self: ConstTypeName,
impl<K: FixedTypeId, V: FixedTypeId, S> FixedTypeId for HashMap<K, V, S>where
Self: ConstTypeName,
Source§impl<R: FixedTypeId> FixedTypeId for fn() -> R
impl<R: FixedTypeId> FixedTypeId for fn() -> R
Source§impl<T1, T2> FixedTypeId for (T1, T2)
impl<T1, T2> FixedTypeId for (T1, T2)
Source§impl<T1, T2, T3> FixedTypeId for (T1, T2, T3)
impl<T1, T2, T3> FixedTypeId for (T1, T2, T3)
Source§impl<T1, T2, T3, T4> FixedTypeId for (T1, T2, T3, T4)
impl<T1, T2, T3, T4> FixedTypeId for (T1, T2, T3, T4)
Source§impl<T1, T2, T3, T4, T5> FixedTypeId for (T1, T2, T3, T4, T5)where
T1: FixedTypeId,
T2: FixedTypeId,
T3: FixedTypeId,
T4: FixedTypeId,
T5: FixedTypeId,
Self: ConstTypeName,
impl<T1, T2, T3, T4, T5> FixedTypeId for (T1, T2, T3, T4, T5)where
T1: FixedTypeId,
T2: FixedTypeId,
T3: FixedTypeId,
T4: FixedTypeId,
T5: FixedTypeId,
Self: ConstTypeName,
Source§impl<T1, T2, T3, T4, T5, T6> FixedTypeId for (T1, T2, T3, T4, T5, T6)where
T1: FixedTypeId,
T2: FixedTypeId,
T3: FixedTypeId,
T4: FixedTypeId,
T5: FixedTypeId,
T6: FixedTypeId,
Self: ConstTypeName,
impl<T1, T2, T3, T4, T5, T6> FixedTypeId for (T1, T2, T3, T4, T5, T6)where
T1: FixedTypeId,
T2: FixedTypeId,
T3: FixedTypeId,
T4: FixedTypeId,
T5: FixedTypeId,
T6: FixedTypeId,
Self: ConstTypeName,
Source§impl<T1, T2, T3, T4, T5, T6, T7> FixedTypeId for (T1, T2, T3, T4, T5, T6, T7)where
T1: FixedTypeId,
T2: FixedTypeId,
T3: FixedTypeId,
T4: FixedTypeId,
T5: FixedTypeId,
T6: FixedTypeId,
T7: FixedTypeId,
Self: ConstTypeName,
impl<T1, T2, T3, T4, T5, T6, T7> FixedTypeId for (T1, T2, T3, T4, T5, T6, T7)where
T1: FixedTypeId,
T2: FixedTypeId,
T3: FixedTypeId,
T4: FixedTypeId,
T5: FixedTypeId,
T6: FixedTypeId,
T7: FixedTypeId,
Self: ConstTypeName,
Source§impl<T1, T2, T3, T4, T5, T6, T7, T8> FixedTypeId for (T1, T2, T3, T4, T5, T6, T7, T8)where
T1: FixedTypeId,
T2: FixedTypeId,
T3: FixedTypeId,
T4: FixedTypeId,
T5: FixedTypeId,
T6: FixedTypeId,
T7: FixedTypeId,
T8: FixedTypeId,
Self: ConstTypeName,
impl<T1, T2, T3, T4, T5, T6, T7, T8> FixedTypeId for (T1, T2, T3, T4, T5, T6, T7, T8)where
T1: FixedTypeId,
T2: FixedTypeId,
T3: FixedTypeId,
T4: FixedTypeId,
T5: FixedTypeId,
T6: FixedTypeId,
T7: FixedTypeId,
T8: FixedTypeId,
Self: ConstTypeName,
Source§impl<T1, T2, T3, T4, T5, T6, T7, T8, T9> FixedTypeId for (T1, T2, T3, T4, T5, T6, T7, T8, T9)where
T1: FixedTypeId,
T2: FixedTypeId,
T3: FixedTypeId,
T4: FixedTypeId,
T5: FixedTypeId,
T6: FixedTypeId,
T7: FixedTypeId,
T8: FixedTypeId,
T9: FixedTypeId,
Self: ConstTypeName,
impl<T1, T2, T3, T4, T5, T6, T7, T8, T9> FixedTypeId for (T1, T2, T3, T4, T5, T6, T7, T8, T9)where
T1: FixedTypeId,
T2: FixedTypeId,
T3: FixedTypeId,
T4: FixedTypeId,
T5: FixedTypeId,
T6: FixedTypeId,
T7: FixedTypeId,
T8: FixedTypeId,
T9: FixedTypeId,
Self: ConstTypeName,
Source§impl<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> FixedTypeId for (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10)where
T1: FixedTypeId,
T2: FixedTypeId,
T3: FixedTypeId,
T4: FixedTypeId,
T5: FixedTypeId,
T6: FixedTypeId,
T7: FixedTypeId,
T8: FixedTypeId,
T9: FixedTypeId,
T10: FixedTypeId,
Self: ConstTypeName,
impl<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> FixedTypeId for (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10)where
T1: FixedTypeId,
T2: FixedTypeId,
T3: FixedTypeId,
T4: FixedTypeId,
T5: FixedTypeId,
T6: FixedTypeId,
T7: FixedTypeId,
T8: FixedTypeId,
T9: FixedTypeId,
T10: FixedTypeId,
Self: ConstTypeName,
Source§impl<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> FixedTypeId for (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11)where
T1: FixedTypeId,
T2: FixedTypeId,
T3: FixedTypeId,
T4: FixedTypeId,
T5: FixedTypeId,
T6: FixedTypeId,
T7: FixedTypeId,
T8: FixedTypeId,
T9: FixedTypeId,
T10: FixedTypeId,
T11: FixedTypeId,
Self: ConstTypeName,
impl<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> FixedTypeId for (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11)where
T1: FixedTypeId,
T2: FixedTypeId,
T3: FixedTypeId,
T4: FixedTypeId,
T5: FixedTypeId,
T6: FixedTypeId,
T7: FixedTypeId,
T8: FixedTypeId,
T9: FixedTypeId,
T10: FixedTypeId,
T11: FixedTypeId,
Self: ConstTypeName,
Source§impl<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> FixedTypeId for (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12)where
T1: FixedTypeId,
T2: FixedTypeId,
T3: FixedTypeId,
T4: FixedTypeId,
T5: FixedTypeId,
T6: FixedTypeId,
T7: FixedTypeId,
T8: FixedTypeId,
T9: FixedTypeId,
T10: FixedTypeId,
T11: FixedTypeId,
T12: FixedTypeId,
Self: ConstTypeName,
impl<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> FixedTypeId for (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12)where
T1: FixedTypeId,
T2: FixedTypeId,
T3: FixedTypeId,
T4: FixedTypeId,
T5: FixedTypeId,
T6: FixedTypeId,
T7: FixedTypeId,
T8: FixedTypeId,
T9: FixedTypeId,
T10: FixedTypeId,
T11: FixedTypeId,
T12: FixedTypeId,
Self: ConstTypeName,
Source§impl<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> FixedTypeId for (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13)where
T1: FixedTypeId,
T2: FixedTypeId,
T3: FixedTypeId,
T4: FixedTypeId,
T5: FixedTypeId,
T6: FixedTypeId,
T7: FixedTypeId,
T8: FixedTypeId,
T9: FixedTypeId,
T10: FixedTypeId,
T11: FixedTypeId,
T12: FixedTypeId,
T13: FixedTypeId,
Self: ConstTypeName,
impl<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> FixedTypeId for (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13)where
T1: FixedTypeId,
T2: FixedTypeId,
T3: FixedTypeId,
T4: FixedTypeId,
T5: FixedTypeId,
T6: FixedTypeId,
T7: FixedTypeId,
T8: FixedTypeId,
T9: FixedTypeId,
T10: FixedTypeId,
T11: FixedTypeId,
T12: FixedTypeId,
T13: FixedTypeId,
Self: ConstTypeName,
Source§impl<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> FixedTypeId for (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14)where
T1: FixedTypeId,
T2: FixedTypeId,
T3: FixedTypeId,
T4: FixedTypeId,
T5: FixedTypeId,
T6: FixedTypeId,
T7: FixedTypeId,
T8: FixedTypeId,
T9: FixedTypeId,
T10: FixedTypeId,
T11: FixedTypeId,
T12: FixedTypeId,
T13: FixedTypeId,
T14: FixedTypeId,
Self: ConstTypeName,
impl<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> FixedTypeId for (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14)where
T1: FixedTypeId,
T2: FixedTypeId,
T3: FixedTypeId,
T4: FixedTypeId,
T5: FixedTypeId,
T6: FixedTypeId,
T7: FixedTypeId,
T8: FixedTypeId,
T9: FixedTypeId,
T10: FixedTypeId,
T11: FixedTypeId,
T12: FixedTypeId,
T13: FixedTypeId,
T14: FixedTypeId,
Self: ConstTypeName,
Source§impl<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15> FixedTypeId for (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15)where
T1: FixedTypeId,
T2: FixedTypeId,
T3: FixedTypeId,
T4: FixedTypeId,
T5: FixedTypeId,
T6: FixedTypeId,
T7: FixedTypeId,
T8: FixedTypeId,
T9: FixedTypeId,
T10: FixedTypeId,
T11: FixedTypeId,
T12: FixedTypeId,
T13: FixedTypeId,
T14: FixedTypeId,
T15: FixedTypeId,
Self: ConstTypeName,
impl<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15> FixedTypeId for (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15)where
T1: FixedTypeId,
T2: FixedTypeId,
T3: FixedTypeId,
T4: FixedTypeId,
T5: FixedTypeId,
T6: FixedTypeId,
T7: FixedTypeId,
T8: FixedTypeId,
T9: FixedTypeId,
T10: FixedTypeId,
T11: FixedTypeId,
T12: FixedTypeId,
T13: FixedTypeId,
T14: FixedTypeId,
T15: FixedTypeId,
Self: ConstTypeName,
Source§impl<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16> FixedTypeId for (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16)where
T1: FixedTypeId,
T2: FixedTypeId,
T3: FixedTypeId,
T4: FixedTypeId,
T5: FixedTypeId,
T6: FixedTypeId,
T7: FixedTypeId,
T8: FixedTypeId,
T9: FixedTypeId,
T10: FixedTypeId,
T11: FixedTypeId,
T12: FixedTypeId,
T13: FixedTypeId,
T14: FixedTypeId,
T15: FixedTypeId,
T16: FixedTypeId,
Self: ConstTypeName,
impl<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16> FixedTypeId for (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16)where
T1: FixedTypeId,
T2: FixedTypeId,
T3: FixedTypeId,
T4: FixedTypeId,
T5: FixedTypeId,
T6: FixedTypeId,
T7: FixedTypeId,
T8: FixedTypeId,
T9: FixedTypeId,
T10: FixedTypeId,
T11: FixedTypeId,
T12: FixedTypeId,
T13: FixedTypeId,
T14: FixedTypeId,
T15: FixedTypeId,
T16: FixedTypeId,
Self: ConstTypeName,
Source§impl<T: ZeroablePrimitive + FixedTypeId> FixedTypeId for NonZero<T>where
Self: ConstTypeName,
impl<T: ZeroablePrimitive + FixedTypeId> FixedTypeId for NonZero<T>where
Self: ConstTypeName,
Source§impl<T: FixedTypeId + ?Sized> FixedTypeId for &T
impl<T: FixedTypeId + ?Sized> FixedTypeId for &T
Source§impl<T: FixedTypeId + ?Sized> FixedTypeId for &mut T
impl<T: FixedTypeId + ?Sized> FixedTypeId for &mut T
Source§impl<T: FixedTypeId + ?Sized> FixedTypeId for Box<T>
impl<T: FixedTypeId + ?Sized> FixedTypeId for Box<T>
Source§impl<T: FixedTypeId> FixedTypeId for &[T]
impl<T: FixedTypeId> FixedTypeId for &[T]
Source§impl<T: FixedTypeId> FixedTypeId for &mut [T]
impl<T: FixedTypeId> FixedTypeId for &mut [T]
Source§impl<T: FixedTypeId> FixedTypeId for Option<T>where
Self: ConstTypeName,
impl<T: FixedTypeId> FixedTypeId for Option<T>where
Self: ConstTypeName,
Source§impl<T: FixedTypeId> FixedTypeId for (T,)
impl<T: FixedTypeId> FixedTypeId for (T,)
Source§impl<T: FixedTypeId> FixedTypeId for VecDeque<T>where
Self: ConstTypeName,
impl<T: FixedTypeId> FixedTypeId for VecDeque<T>where
Self: ConstTypeName,
Source§impl<T: FixedTypeId> FixedTypeId for Vec<T>where
Self: ConstTypeName,
impl<T: FixedTypeId> FixedTypeId for Vec<T>where
Self: ConstTypeName,
Source§impl<T: FixedTypeId> FixedTypeId for PhantomData<T>where
Self: ConstTypeName,
impl<T: FixedTypeId> FixedTypeId for PhantomData<T>where
Self: ConstTypeName,
Source§impl<T: FixedTypeId> FixedTypeId for Range<T>where
Self: ConstTypeName,
impl<T: FixedTypeId> FixedTypeId for Range<T>where
Self: ConstTypeName,
Source§impl<T: FixedTypeId> FixedTypeId for RangeFrom<T>where
Self: ConstTypeName,
impl<T: FixedTypeId> FixedTypeId for RangeFrom<T>where
Self: ConstTypeName,
Source§impl<T: FixedTypeId> FixedTypeId for RangeTo<T>where
Self: ConstTypeName,
impl<T: FixedTypeId> FixedTypeId for RangeTo<T>where
Self: ConstTypeName,
Source§impl<T: FixedTypeId> FixedTypeId for RangeToInclusive<T>where
Self: ConstTypeName,
impl<T: FixedTypeId> FixedTypeId for RangeToInclusive<T>where
Self: ConstTypeName,
Source§impl<T: FixedTypeId, E: FixedTypeId> FixedTypeId for Result<T, E>where
Self: ConstTypeName,
impl<T: FixedTypeId, E: FixedTypeId> FixedTypeId for Result<T, E>where
Self: ConstTypeName,
Source§impl<T: FixedTypeId, R: FixedTypeId> FixedTypeId for fn(T) -> R
impl<T: FixedTypeId, R: FixedTypeId> FixedTypeId for fn(T) -> R
Source§impl<T: FixedTypeId, const N: usize> FixedTypeId for [T; N]
Only valid for N <= 32
impl<T: FixedTypeId, const N: usize> FixedTypeId for [T; N]
Only valid for N <= 32