abi_stable::type_level::downcasting

Trait GetUTID

Source
pub trait GetUTID<T> {
    const UID: extern "C" fn() -> MaybeCmp<UTypeId>;
}
Expand description

Gets a function optionally returning the UTypeId of T.

Whether the function returns MaybeCmp::Just(typeid) is determined by implementors:

  • TD_CanDowncast: the function always returns MaybeCmp::Just(typeid).

  • TD_Opaque: the function always returns MaybeCmp::Nothing.

Required Associated Constants§

Source

const UID: extern "C" fn() -> MaybeCmp<UTypeId>

the function.

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.

Implementors§

Source§

impl<T> GetUTID<T> for TD_CanDowncast
where T: 'static,

Source§

const UID: extern "C" fn() -> MaybeCmp<UTypeId> = _

Source§

impl<T> GetUTID<T> for TD_Opaque

Source§

const UID: extern "C" fn() -> MaybeCmp<UTypeId> = {std_types::utypeid::no_utypeid as extern "C" fn() -> sabi_types::maybe_cmp::MaybeCmp<std_types::utypeid::UTypeId>}