FixedTypeId

Trait FixedTypeId 

Source
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§

Source

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§

Source

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.

Source

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§

Source

fn ty_name(&self) -> &'static str

Returns the type name.

Source

fn ty_id(&self) -> FixedId

Returns the type id number.

Source

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

Source§

const TYPE_NAME: &'static str = "core::convert::Infallible"

Source§

const TYPE_ID: FixedId

Source§

const TYPE_VERSION: FixedVersion

Source§

fn ty_name(&self) -> &'static str

Source§

fn ty_id(&self) -> FixedId

Source§

fn ty_version(&self) -> FixedVersion

Source§

impl FixedTypeId for bool

Source§

impl FixedTypeId for char

Source§

impl FixedTypeId for f32

Source§

impl FixedTypeId for f64

Source§

impl FixedTypeId for i8

Source§

impl FixedTypeId for i16

Source§

impl FixedTypeId for i32

Source§

impl FixedTypeId for i64

Source§

impl FixedTypeId for i128

Source§

impl FixedTypeId for isize

Source§

impl FixedTypeId for str

Source§

impl FixedTypeId for u8

Source§

impl FixedTypeId for u16

Source§

impl FixedTypeId for u32

Source§

impl FixedTypeId for u64

Source§

impl FixedTypeId for u128

Source§

impl FixedTypeId for ()

Source§

const TYPE_NAME: &'static str = "()"

Source§

impl FixedTypeId for usize

Source§

impl FixedTypeId for String

Source§

const TYPE_NAME: &'static str = "alloc::string::String"

Source§

const TYPE_ID: FixedId

Source§

const TYPE_VERSION: FixedVersion

Source§

fn ty_name(&self) -> &'static str

Source§

fn ty_id(&self) -> FixedId

Source§

fn ty_version(&self) -> FixedVersion

Source§

impl FixedTypeId for RangeFull

Source§

const TYPE_NAME: &'static str = "core::ops::RangeFull"

Source§

const TYPE_ID: FixedId

Source§

const TYPE_VERSION: FixedVersion

Source§

fn ty_name(&self) -> &'static str

Source§

fn ty_id(&self) -> FixedId

Source§

fn ty_version(&self) -> FixedVersion

Source§

impl FixedTypeId for Duration

Source§

const TYPE_NAME: &'static str = "core::time::Duration"

Source§

const TYPE_ID: FixedId

Source§

const TYPE_VERSION: FixedVersion

Source§

fn ty_name(&self) -> &'static str

Source§

fn ty_id(&self) -> FixedId

Source§

fn ty_version(&self) -> FixedVersion

Source§

impl FixedTypeId for dyn Any

Source§

const TYPE_NAME: &'static str = "dyn core::any::Any"

Source§

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,

Source§

impl<R: FixedTypeId> FixedTypeId for fn() -> R

Source§

const TYPE_NAME: &'static str

Source§

impl<T1, T2> FixedTypeId for (T1, T2)
where T1: FixedTypeId, T2: FixedTypeId, Self: ConstTypeName,

Source§

const TYPE_NAME: &'static str

Source§

impl<T1, T2, T3> FixedTypeId for (T1, T2, T3)
where T1: FixedTypeId, T2: FixedTypeId, T3: FixedTypeId, Self: ConstTypeName,

Source§

const TYPE_NAME: &'static str

Source§

impl<T1, T2, T3, T4> FixedTypeId for (T1, T2, T3, T4)

Source§

const TYPE_NAME: &'static str

Source§

impl<T1, T2, T3, T4, T5> FixedTypeId for (T1, T2, T3, T4, T5)

Source§

const TYPE_NAME: &'static str

Source§

impl<T1, T2, T3, T4, T5, T6> FixedTypeId for (T1, T2, T3, T4, T5, T6)

Source§

const TYPE_NAME: &'static str

Source§

impl<T1, T2, T3, T4, T5, T6, T7> FixedTypeId for (T1, T2, T3, T4, T5, T6, T7)

Source§

const TYPE_NAME: &'static str

Source§

impl<T1, T2, T3, T4, T5, T6, T7, T8> FixedTypeId for (T1, T2, T3, T4, T5, T6, T7, T8)

Source§

const TYPE_NAME: &'static str

Source§

impl<T1, T2, T3, T4, T5, T6, T7, T8, T9> FixedTypeId for (T1, T2, T3, T4, T5, T6, T7, T8, T9)

Source§

const TYPE_NAME: &'static str

Source§

impl<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> FixedTypeId for (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10)

Source§

const TYPE_NAME: &'static str

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)

Source§

const TYPE_NAME: &'static str

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)

Source§

const TYPE_NAME: &'static str

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)

Source§

const TYPE_NAME: &'static str

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)

Source§

const TYPE_NAME: &'static str

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)

Source§

const TYPE_NAME: &'static str

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)

Source§

const TYPE_NAME: &'static str

Source§

impl<T: ZeroablePrimitive + FixedTypeId> FixedTypeId for NonZero<T>
where Self: ConstTypeName,

Source§

impl<T: FixedTypeId + ?Sized> FixedTypeId for &T

Source§

const TYPE_NAME: &'static str

Source§

impl<T: FixedTypeId + ?Sized> FixedTypeId for &mut T

Source§

const TYPE_NAME: &'static str

Source§

impl<T: FixedTypeId + ?Sized> FixedTypeId for Box<T>

Source§

const TYPE_NAME: &'static str

Source§

impl<T: FixedTypeId> FixedTypeId for &[T]

Source§

const TYPE_NAME: &'static str

Source§

impl<T: FixedTypeId> FixedTypeId for &mut [T]

Source§

const TYPE_NAME: &'static str

Source§

impl<T: FixedTypeId> FixedTypeId for Option<T>
where Self: ConstTypeName,

Source§

impl<T: FixedTypeId> FixedTypeId for (T,)

Source§

const TYPE_NAME: &'static str

Source§

impl<T: FixedTypeId> FixedTypeId for VecDeque<T>
where Self: ConstTypeName,

Source§

impl<T: FixedTypeId> FixedTypeId for Vec<T>
where Self: ConstTypeName,

Source§

impl<T: FixedTypeId> FixedTypeId for PhantomData<T>
where Self: ConstTypeName,

Source§

impl<T: FixedTypeId> FixedTypeId for Range<T>
where Self: ConstTypeName,

Source§

impl<T: FixedTypeId> FixedTypeId for RangeFrom<T>
where Self: ConstTypeName,

Source§

impl<T: FixedTypeId> FixedTypeId for RangeTo<T>
where Self: ConstTypeName,

Source§

impl<T: FixedTypeId> FixedTypeId for RangeToInclusive<T>
where Self: ConstTypeName,

Source§

impl<T: FixedTypeId, E: FixedTypeId> FixedTypeId for Result<T, E>
where Self: ConstTypeName,

Source§

impl<T: FixedTypeId, R: FixedTypeId> FixedTypeId for fn(T) -> R

Source§

const TYPE_NAME: &'static str

Source§

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

Only valid for N <= 32

Source§

const TYPE_NAME: &'static str

Implementors§