[−][src]Trait fixed::traits::LossyInto
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 fixed::traits::LossyInto; use fixed::types::{I12F4, I8F24}; // original is 0x12.345678, lossy is 0x012.3 let original = I8F24::from_bits(0x1234_5678); let lossy: I12F4 = original.lossy_into(); assert_eq!(lossy, I12F4::from_bits(0x0123));
Required methods
fn lossy_into(self) -> Dst
Performs the conversion.
Implementors
impl<Src, Dst> LossyInto<Dst> for Src where
Dst: LossyFrom<Src>,
[src]
Dst: LossyFrom<Src>,