Module gazebo::coerce [−][src]
Expand description
A trait to represent zero-cost conversions.
Traits
A marker trait such that the existence of From: Coerce<To>
implies
that From
can be treat as To
without any data manipulation.
Particularly useful for containers, e.g. Vec<From>
can be treated as
Vec<To>
in O(1). If such an instance is available,
you can use coerce
and coerce_ref
to perform the conversion.
Functions
Safely convert between types which have a Coerce
relationship.
Often the second type argument will need to be given explicitly,
e.g. coerce::<_, ToType>(x)
.
Safely convert between types which have a Coerce
relationship.
Often the second type argument will need to be given explicitly,
e.g. coerce_ref::<_, ToType>(x)
.