Trait ReturnTypeReflection

Source
pub trait ReturnTypeReflection: Sized {
    // Required methods
    fn accepts_type(ty: &Type) -> bool;
    fn type_hint() -> &'static str;
}
Expand description

A type to emulate dynamic typing across compilation units for static types.

Required Methods§

Source

fn accepts_type(ty: &Type) -> bool

Returns true if this specified type can be stored in an instance Self.

Source

fn type_hint() -> &'static str

Returns a type hint to indicate the name of this 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 ReturnTypeReflection for bool

Source§

fn accepts_type(ty: &Type) -> bool

Source§

fn type_hint() -> &'static str

Source§

impl ReturnTypeReflection for f32

Source§

fn accepts_type(ty: &Type) -> bool

Source§

fn type_hint() -> &'static str

Source§

impl ReturnTypeReflection for f64

Source§

fn accepts_type(ty: &Type) -> bool

Source§

fn type_hint() -> &'static str

Source§

impl ReturnTypeReflection for i8

Source§

fn accepts_type(ty: &Type) -> bool

Source§

fn type_hint() -> &'static str

Source§

impl ReturnTypeReflection for i16

Source§

fn accepts_type(ty: &Type) -> bool

Source§

fn type_hint() -> &'static str

Source§

impl ReturnTypeReflection for i32

Source§

fn accepts_type(ty: &Type) -> bool

Source§

fn type_hint() -> &'static str

Source§

impl ReturnTypeReflection for i64

Source§

fn accepts_type(ty: &Type) -> bool

Source§

fn type_hint() -> &'static str

Source§

impl ReturnTypeReflection for i128

Source§

fn accepts_type(ty: &Type) -> bool

Source§

fn type_hint() -> &'static str

Source§

impl ReturnTypeReflection for isize

Source§

fn accepts_type(ty: &Type) -> bool

Source§

fn type_hint() -> &'static str

Source§

impl ReturnTypeReflection for u8

Source§

fn accepts_type(ty: &Type) -> bool

Source§

fn type_hint() -> &'static str

Source§

impl ReturnTypeReflection for u16

Source§

fn accepts_type(ty: &Type) -> bool

Source§

fn type_hint() -> &'static str

Source§

impl ReturnTypeReflection for u32

Source§

fn accepts_type(ty: &Type) -> bool

Source§

fn type_hint() -> &'static str

Source§

impl ReturnTypeReflection for u64

Source§

fn accepts_type(ty: &Type) -> bool

Source§

fn type_hint() -> &'static str

Source§

impl ReturnTypeReflection for u128

Source§

fn accepts_type(ty: &Type) -> bool

Source§

fn type_hint() -> &'static str

Source§

impl ReturnTypeReflection for ()

Source§

fn accepts_type(ty: &Type) -> bool

Source§

fn type_hint() -> &'static str

Source§

impl ReturnTypeReflection for usize

Source§

fn accepts_type(ty: &Type) -> bool

Source§

fn type_hint() -> &'static str

Source§

impl<T> ReturnTypeReflection for *const T

Source§

fn accepts_type(ty: &Type) -> bool

Source§

fn type_hint() -> &'static str

Source§

impl<T> ReturnTypeReflection for *mut T

Source§

fn accepts_type(ty: &Type) -> bool

Source§

fn type_hint() -> &'static str

Implementors§