Trait substrate_fixed::traits::LossyInto [−][src]
This trait provides infallible conversions that might be lossy.
This is the reciprocal of LossyFrom
.
Usually LossyFrom
should be implemented instead of this trait;
there is a blanket implementation which provides this trait when
LossyFrom
is implemented (similar to Into
and From
).
Examples
use substrate_fixed::traits::LossyInto; use substrate_fixed::types::{I12F4, I4F12}; // original is 0x1.234 let original = I4F12::from_bits(0x1234); let lossy: I12F4 = original.lossy_into(); assert_eq!(lossy, I12F4::from_bits(0x0012));
Required methods
fn lossy_into(self) -> Dst
[src]
Performs the conversion.
Implementors
impl<Src, Dst> LossyInto<Dst> for Src where
Dst: LossyFrom<Src>,
[src]
Dst: LossyFrom<Src>,