pub struct Converted<T> {
pub value: T,
pub lossy: Lossy,
}Available on crate feature
convert only.Expand description
The result of a version conversion: the object, and what it cost.
Fields§
§value: TThe converted object.
lossy: LossyEverything that could not be carried across.
Implementations§
Source§impl<T> Converted<T>
impl<T> Converted<T>
Sourcepub fn is_lossless(&self) -> bool
pub fn is_lossless(&self) -> bool
Whether nothing was lost.
Sourcepub fn ignore_losses(self) -> T
pub fn ignore_losses(self) -> T
The object, discarding the report.
Named to be conspicuous: reaching for this is how a hub silently loses data.
Sourcepub fn into_lossless(self) -> Result<T, Lossy>
pub fn into_lossless(self) -> Result<T, Lossy>
Sourcepub fn expect_lossless(self) -> T
pub fn expect_lossless(self) -> T
The object, panicking if anything was lost. For tests and examples.
§Panics
Panics when the conversion lost something.
Trait Implementations§
impl<T: PartialEq> StructuralPartialEq for Converted<T>
Auto Trait Implementations§
impl<T> Freeze for Converted<T>where
T: Freeze,
impl<T> RefUnwindSafe for Converted<T>where
T: RefUnwindSafe,
impl<T> Send for Converted<T>where
T: Send,
impl<T> Sync for Converted<T>where
T: Sync,
impl<T> Unpin for Converted<T>where
T: Unpin,
impl<T> UnsafeUnpin for Converted<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for Converted<T>where
T: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more