pub trait IntoSafeCast<T> {
// Required method
fn into_safe_cast(self) -> T;
}Expand description
Counterpart to the FromSafeCast trait, i.e. this trait is to FromSafeCast what Into
is to From.
See the documentation of FromSafeCast for the motivation.
§Examples
use kernel::num::casts::IntoSafeCast;
assert_eq!(0xf00usize, 0xf00u32.into_safe_cast());Required Methods§
Sourcefn into_safe_cast(self) -> T
fn into_safe_cast(self) -> T
Convert self into a T. This operation is guaranteed to be lossless.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementors§
impl<S, T> IntoSafeCast<T> for Swhere
T: FromSafeCast<S>,
Reverse operation for types implementing FromSafeCast.