Struct deref_owned::Owned
source · [−]pub struct Owned<'a, B, O> where
B: ?Sized, {
pub borrowed: PhantomData<&'a B>,
pub owned: O,
}
Expand description
Smart pointer to value that can be borrowed from owned inner value
Fields
borrowed: PhantomData<&'a B>
owned: O
Implementations
Trait Implementations
sourceimpl<'a, B, O> GenericCow for Owned<'a, B, O> where
B: ?Sized,
O: Borrow<B>,
impl<'a, B, O> GenericCow for Owned<'a, B, O> where
B: ?Sized,
O: Borrow<B>,
type Owned = O
type Owned = O
The type the pointer can be converted into
sourcefn into_owned(self) -> Self::Owned
fn into_owned(self) -> Self::Owned
Convert into owned type
sourceimpl<'a, B: Ord, O: Ord> Ord for Owned<'a, B, O> where
B: ?Sized,
impl<'a, B: Ord, O: Ord> Ord for Owned<'a, B, O> where
B: ?Sized,
sourceimpl<'a, B: PartialEq, O: PartialEq> PartialEq<Owned<'a, B, O>> for Owned<'a, B, O> where
B: ?Sized,
impl<'a, B: PartialEq, O: PartialEq> PartialEq<Owned<'a, B, O>> for Owned<'a, B, O> where
B: ?Sized,
sourceimpl<'a, B: PartialOrd, O: PartialOrd> PartialOrd<Owned<'a, B, O>> for Owned<'a, B, O> where
B: ?Sized,
impl<'a, B: PartialOrd, O: PartialOrd> PartialOrd<Owned<'a, B, O>> for Owned<'a, B, O> where
B: ?Sized,
sourcefn partial_cmp(&self, other: &Owned<'a, B, O>) -> Option<Ordering>
fn partial_cmp(&self, other: &Owned<'a, B, O>) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
impl<'a, B: Eq, O: Eq> Eq for Owned<'a, B, O> where
B: ?Sized,
impl<'a, B, O> StructuralEq for Owned<'a, B, O> where
B: ?Sized,
impl<'a, B, O> StructuralPartialEq for Owned<'a, B, O> where
B: ?Sized,
Auto Trait Implementations
impl<'a, B: ?Sized, O> RefUnwindSafe for Owned<'a, B, O> where
B: RefUnwindSafe,
O: RefUnwindSafe,
impl<'a, B: ?Sized, O> Send for Owned<'a, B, O> where
B: Sync,
O: Send,
impl<'a, B: ?Sized, O> Sync for Owned<'a, B, O> where
B: Sync,
O: Sync,
impl<'a, B: ?Sized, O> Unpin for Owned<'a, B, O> where
O: Unpin,
impl<'a, B: ?Sized, O> UnwindSafe for Owned<'a, B, O> where
B: RefUnwindSafe,
O: UnwindSafe,
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