Enum flex_alloc::borrow::Cow
source · pub enum Cow<'b, T: ToOwnedIn<A> + ?Sized, A: RawAlloc> {
Borrowed(&'b T),
Owned(Owned<T, A>),
}Variants§
Implementations§
source§impl<'b, T: ToOwnedIn<A> + ?Sized, A: RawAlloc> Cow<'b, T, A>
impl<'b, T: ToOwnedIn<A> + ?Sized, A: RawAlloc> Cow<'b, T, A>
pub fn is_borrowed(&self) -> bool
pub fn is_owned(&self) -> bool
pub fn to_mut(&mut self) -> &mut Owned<T, A>where
A: RawAllocNew,
pub fn into_owned(self) -> Owned<T, A>where
A: RawAllocNew,
pub fn into_owned_in<I>(self, alloc_in: I) -> Owned<T, A>where
I: RawAllocIn<RawAlloc = A>,
pub fn try_into_owned(self) -> Result<Owned<T, A>, StorageError>where
A: RawAllocNew,
pub fn try_into_owned_in<I>(
self,
storage: I,
) -> Result<Owned<T, A>, StorageError>where
I: RawAllocIn<RawAlloc = A>,
Trait Implementations§
source§impl<'a, T: Clone, A: RawAllocNew> FromIterator<T> for Cow<'a, [T], A>
impl<'a, T: Clone, A: RawAllocNew> FromIterator<T> for Cow<'a, [T], A>
source§impl<'a, 'b, T, A: RawAlloc, U: ToOwnedIn<B> + ?Sized, B: RawAlloc> PartialEq<Cow<'b, U, B>> for Cow<'a, T, A>
impl<'a, 'b, T, A: RawAlloc, U: ToOwnedIn<B> + ?Sized, B: RawAlloc> PartialEq<Cow<'b, U, B>> for Cow<'a, T, A>
impl<'a, T: ToOwnedIn<A> + Eq + ?Sized, A: RawAlloc> Eq for Cow<'a, T, A>
Auto Trait Implementations§
impl<'b, T, A> Freeze for Cow<'b, T, A>
impl<'b, T, A> RefUnwindSafe for Cow<'b, T, A>
impl<'b, T, A> Send for Cow<'b, T, A>
impl<'b, T, A> Sync for Cow<'b, T, A>
impl<'b, T, A> Unpin for Cow<'b, T, A>
impl<'b, T, A> UnwindSafe for Cow<'b, T, A>
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit)