pub struct Owned<B>(pub B::Owning)
where
B: ToOwning + ?Sized;
Expand description
A StaticCow
implementation which wraps an owned type.
Tuple Fields§
§0: B::Owning
Trait Implementations§
Source§impl<B> IntoOwning for Owned<B>
impl<B> IntoOwning for Owned<B>
Source§fn into_owning(self) -> Self::Owning
fn into_owning(self) -> Self::Owning
Converts an object which owns its contents into one which borrows them.
Source§impl<B> Ord for Owned<B>
impl<B> Ord for Owned<B>
Source§impl<B> PartialOrd for Owned<B>
impl<B> PartialOrd for Owned<B>
Source§impl<B> StaticCow<B> for Owned<B>
impl<B> StaticCow<B> for Owned<B>
Source§fn is_owned(&self) -> bool
fn is_owned(&self) -> bool
Returns true iff the data is owned, i.e. if
self.into_owning()
would
be a no-op.Source§fn mut_if_owned(&mut self) -> MutIfOwned<'_, B>
fn mut_if_owned(&mut self) -> MutIfOwned<'_, B>
Returns either an immutable reference to an object that is borrowed, or
a mutable reference to one which is owned. Read more
Source§fn into_cow<'a>(self) -> Cow<'a, B>where
Self: 'a,
Self::Owning: 'a,
fn into_cow<'a>(self) -> Cow<'a, B>where
Self: 'a,
Self::Owning: 'a,
Converts
self
into its dynamic equivalent as a Cow
.Source§fn into_owned(self) -> <B as ToOwned>::Owned
fn into_owned(self) -> <B as ToOwned>::Owned
Converts
self
into a B::Owned
, cloning only if necessary.Source§fn is_borrowed(&self) -> bool
fn is_borrowed(&self) -> bool
Returns true iff the data is borrowed, i.e. if
self.into_owning()
would clone it.impl<B> Eq for Owned<B>
impl<B> StructuralPartialEq for Owned<B>
Auto Trait Implementations§
impl<B> Freeze for Owned<B>
impl<B> RefUnwindSafe for Owned<B>
impl<B> Send for Owned<B>
impl<B> Sync for Owned<B>
impl<B> Unpin for Owned<B>
impl<B> UnwindSafe for Owned<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