Trait detrojt::TyConst
[−]
[src]
pub trait TyConst<T: ?Sized + 'static>: Sized + 'static { fn get_data() -> Self; }
This represents a mapping from a type T to some data of type Self
(also
referred to as D
in other places).
You can implement this trait for your own datatype D
to associate
arbitrary data with types. The data can be retrieved using
get_ty_const
even if T
is not statically
known.
The ordering of type parameters here is needed to avoid problems due to orphan rules.
Required Methods
fn get_data() -> Self
Retrieve the data.