pub enum MaybeBoxed<'a, B: 'a + ?Sized> {
Borrowed(&'a B),
Boxed(Box<B>),
}Expand description
An optionally-owning (boxed) reference
This is related but not identical to Cow.
Variants§
Trait Implementations§
Auto Trait Implementations§
impl<'a, B> Freeze for MaybeBoxed<'a, B>where
B: ?Sized,
impl<'a, B> RefUnwindSafe for MaybeBoxed<'a, B>where
B: RefUnwindSafe + ?Sized,
impl<'a, B> Send for MaybeBoxed<'a, B>
impl<'a, B> Sync for MaybeBoxed<'a, B>
impl<'a, B> Unpin for MaybeBoxed<'a, B>where
B: ?Sized,
impl<'a, B> UnwindSafe for MaybeBoxed<'a, B>
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
Source§impl<S, T> CastApprox<T> for Swhere
T: ConvApprox<S>,
impl<S, T> CastApprox<T> for Swhere
T: ConvApprox<S>,
Source§fn try_cast_approx(self) -> Result<T, Error>
fn try_cast_approx(self) -> Result<T, Error>
Source§fn cast_approx(self) -> T
fn cast_approx(self) -> T
Source§impl<S, T> CastFloat<T> for Swhere
T: ConvFloat<S>,
impl<S, T> CastFloat<T> for Swhere
T: ConvFloat<S>,
Source§fn cast_trunc(self) -> T
fn cast_trunc(self) -> T
Cast to integer, truncating Read more
Source§fn cast_nearest(self) -> T
fn cast_nearest(self) -> T
Cast to the nearest integer Read more
Source§fn cast_floor(self) -> T
fn cast_floor(self) -> T
Cast the floor to an integer Read more