Expand description
Macros
Traits
Conversion methods from a container type (such as an
enum
) and a target type T
.Blanket implementation of a convenience method
matches
which allows calling
can_cast_from
with a type parameter. Do not implement this trait.Trait for defining a cast operation when the source type cannot always be cast to the
destination type. Defines a
can_cast_from
method which borrows the source value, allowing
for pattern matching without moving the value. When can_cast_from
returns true
, calling
opt_cast_from
must return Some(...)
, otherwise try_cast_from
may panic.Trait for defining a cast operation when the destination type cannot always be cast from the
source type. Defines a
can_cast_into
method which borrows self
, allowing for pattern
matching without moving self
. If can_cast_into
returns true
, then calling
opt_cast_into
must return Some(...)
, otherwise try_cast_into
may panic.