Trait safecast::CastFrom [−][src]
pub trait CastFrom<T> {
fn cast_from(value: T) -> Self;
}
Expand description
Trait for defining a cast operation from some source type T
.
Analogous to std::convert::From
.
The inverse of CastInto
.
Prefer implementing CastFrom
over CastInto
because implementing CastFrom
automatically
provides an implementation of CastInto
.