Struct deref_owned::Owned
source · [−]pub struct Owned<B, O> where
B: ?Sized, {
pub borrowed: PhantomData<for<'a> fn(_: &'a O) -> &'a B>,
pub owned: O,
}
Expand description
Smart pointer to value that can be borrowed from owned inner value
Fields
borrowed: PhantomData<for<'a> fn(_: &'a O) -> &'a B>
owned: O
Implementations
Trait Implementations
sourceimpl<B, O> GenericCow for Owned<B, O> where
B: ?Sized,
O: Borrow<B>,
impl<B, O> GenericCow for Owned<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<B: Ord, O: Ord> Ord for Owned<B, O> where
B: ?Sized,
impl<B: Ord, O: Ord> Ord for Owned<B, O> where
B: ?Sized,
sourceimpl<B: PartialOrd, O: PartialOrd> PartialOrd<Owned<B, O>> for Owned<B, O> where
B: ?Sized,
impl<B: PartialOrd, O: PartialOrd> PartialOrd<Owned<B, O>> for Owned<B, O> where
B: ?Sized,
sourcefn partial_cmp(&self, other: &Owned<B, O>) -> Option<Ordering>
fn partial_cmp(&self, other: &Owned<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<B: Eq, O: Eq> Eq for Owned<B, O> where
B: ?Sized,
impl<B, O> StructuralEq for Owned<B, O> where
B: ?Sized,
impl<B, O> StructuralPartialEq for Owned<B, O> where
B: ?Sized,
Auto Trait Implementations
impl<B: ?Sized, O> RefUnwindSafe for Owned<B, O> where
O: RefUnwindSafe,
impl<B: ?Sized, O> Send for Owned<B, O> where
O: Send,
impl<B: ?Sized, O> Sync for Owned<B, O> where
O: Sync,
impl<B: ?Sized, O> Unpin for Owned<B, O> where
O: Unpin,
impl<B: ?Sized, O> UnwindSafe for Owned<B, O> where
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