pub enum RefOrVal<'a, T> {
Ref(&'a T),
Val(T),
}
Expand description
Represent a reference to T or a direct T
Variants
Ref(&'a T)
Val(T)
Implementations
Trait Implementations
impl<'a, T: Eq> Eq for RefOrVal<'a, T>
Auto Trait Implementations
impl<'a, T> RefUnwindSafe for RefOrVal<'a, T> where
T: RefUnwindSafe,
impl<'a, T> Send for RefOrVal<'a, T> where
T: Send + Sync,
impl<'a, T> Sync for RefOrVal<'a, T> where
T: Sync,
impl<'a, T> Unpin for RefOrVal<'a, T> where
T: Unpin,
impl<'a, T> UnwindSafe for RefOrVal<'a, T> where
T: UnwindSafe + RefUnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more