Struct typedef::TypeDef
[−]
[src]
pub struct TypeDef { /* fields omitted */ }
Methods
impl TypeDef
[src]
fn of<T: Any>() -> TypeDef
[src]
Create a TypeDef structure from a type parameter.
use typedef::{ TypeDef }; let _typedef = TypeDef::of::<i64>();
fn id_of<T: Any>() -> TypeId
[src]
Get TypeId
for specified type directly.
use std::any::{ TypeId }; use typedef::{ TypeDef }; assert!(TypeDef::id_of::<i64>() == TypeId::of::<i64>());
fn name_of<T: Any>() -> Cow<'static, str>
[src]
Get type name for specified type directly.
This only works if this crate is compiled with features = ["nightly"]
use typedef::{ TypeDef }; assert_eq!(TypeDef::name_of::<i64>(), "i64");
fn is<T: Any>(&self) -> bool
[src]
Check if typedef instance matches type.
use typedef::{ TypeDef }; let typedef = TypeDef::of::<i64>(); assert!(typedef.is::<i64>());
fn get_str(&self) -> Cow<'static, str>
[src]
Get the static &str
for typedef instance.
This only works if this crate is compiled with features = ["nightly"]
use typedef::{ TypeDef }; let typedef = TypeDef::of::<i64>(); assert!(typedef.get_str() == "i64");
Trait Implementations
impl Clone for TypeDef
[src]
fn clone(&self) -> TypeDef
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Copy for TypeDef
[src]
impl Eq for TypeDef
[src]
impl Ord for TypeDef
[src]
fn cmp(&self, __arg_0: &TypeDef) -> Ordering
[src]
This method returns an Ordering
between self
and other
. Read more
fn max(self, other: Self) -> Self
1.22.0[src]
Compares and returns the maximum of two values. Read more
fn min(self, other: Self) -> Self
1.22.0[src]
Compares and returns the minimum of two values. Read more
impl Debug for TypeDef
[src]
impl PartialOrd for TypeDef
[src]
fn partial_cmp(&self, other: &TypeDef) -> Option<Ordering>
[src]
This method returns an ordering between self
and other
values if one exists. Read more
fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests less than (for self
and other
) and is used by the <
operator. Read more
fn le(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
impl Hash for TypeDef
[src]
fn hash<H: Hasher>(&self, state: &mut H)
[src]
Feeds this value into the given [Hasher
]. Read more
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more
impl PartialEq for TypeDef
[src]
fn eq(&self, other: &TypeDef) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests for !=
.