pub enum MaybeBorrowed<'a, T> {
Borrowed(&'a T),
Owned(T),
}
Expand description
A value that is either borrowed or owned.
This is similar to std::borrow::Cow
, but does not require the ability to convert from
borrowed to owned.
Variants§
Trait Implementations§
source§impl<'a, T> AsRef<T> for MaybeBorrowed<'a, T>
impl<'a, T> AsRef<T> for MaybeBorrowed<'a, T>
source§impl<'a, T: Debug> Debug for MaybeBorrowed<'a, T>
impl<'a, T: Debug> Debug for MaybeBorrowed<'a, T>
Auto Trait Implementations§
impl<'a, T> Freeze for MaybeBorrowed<'a, T>where
T: Freeze,
impl<'a, T> RefUnwindSafe for MaybeBorrowed<'a, T>where
T: RefUnwindSafe,
impl<'a, T> Send for MaybeBorrowed<'a, T>
impl<'a, T> Sync for MaybeBorrowed<'a, T>where
T: Sync,
impl<'a, T> Unpin for MaybeBorrowed<'a, T>where
T: Unpin,
impl<'a, T> UnwindSafe for MaybeBorrowed<'a, T>where
T: UnwindSafe + RefUnwindSafe,
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