[−][src]Struct beef::Cow
A clone-on-write smart pointer, mostly compatible with std::borrow::Cow
.
Methods
impl<'_, B: ?Sized> Cow<'_, B> where
B: Beef,
[src]
B: Beef,
impl<'a, T: ?Sized> Cow<'a, T> where
T: Beef,
[src]
T: Beef,
pub fn borrowed(val: &'a T) -> Self
[src]
Owned data.
pub fn into_owned(self) -> T::Owned
[src]
Extracts the owned data.
Clones the data if it is not already owned.
Trait Implementations
impl<'_, T: ?Sized> AsRef<T> for Cow<'_, T> where
T: Beef,
[src]
T: Beef,
impl<'_, T: ?Sized> Borrow<T> for Cow<'_, T> where
T: Beef,
[src]
T: Beef,
impl<'a, T: ?Sized> Clone for Cow<'a, T> where
T: Beef,
[src]
T: Beef,
fn clone(&self) -> Self
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<'_, T: Beef + Debug + ?Sized> Debug for Cow<'_, T>
[src]
impl<'_, T: ?Sized> Deref for Cow<'_, T> where
T: Beef,
[src]
T: Beef,
impl<'_, T: Beef + Display + ?Sized> Display for Cow<'_, T>
[src]
impl<'_, T: ?Sized> Drop for Cow<'_, T> where
T: Beef,
[src]
T: Beef,
impl<'a, T: Eq + Beef + ?Sized + 'a> Eq for Cow<'a, T>
[src]
impl<'a, T: ?Sized> From<&'a T> for Cow<'a, T> where
T: Beef,
[src]
T: Beef,
impl<'a, T: ?Sized> From<Cow<'a, T>> for Cow<'a, T> where
T: Beef,
[src]
T: Beef,
impl<'a, T: ?Sized> From<Cow<'a, T>> for StdCow<'a, T> where
T: Beef,
[src]
T: Beef,
impl<'_> From<String> for Cow<'_, str>
[src]
impl<'_, T> From<Vec<T>> for Cow<'_, [T]> where
T: Clone,
[src]
T: Clone,
impl<'_, T: ?Sized> Hash for Cow<'_, T> where
T: Hash + Beef,
[src]
T: Hash + Beef,
fn hash<H: Hasher>(&self, state: &mut H)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl<'_, T> PartialEq<Cow<'_, [T]>> for [T] where
T: Clone + PartialEq,
[T]: Beef,
[src]
T: Clone + PartialEq,
[T]: Beef,
impl<'_, '_, T> PartialEq<Cow<'_, [T]>> for &'_ [T] where
T: Clone + PartialEq,
[T]: Beef,
[src]
T: Clone + PartialEq,
[T]: Beef,
impl<'_, T> PartialEq<Cow<'_, [T]>> for Vec<T> where
T: Clone + PartialEq,
[T]: Beef,
[src]
T: Clone + PartialEq,
[T]: Beef,
impl<'_> PartialEq<Cow<'_, str>> for str
[src]
impl<'_, '_> PartialEq<Cow<'_, str>> for &'_ str
[src]
impl<'_> PartialEq<Cow<'_, str>> for String
[src]
impl<'_, T: ?Sized, U: ?Sized> PartialEq<U> for Cow<'_, T> where
T: Beef + PartialEq,
U: AsRef<T>,
[src]
T: Beef + PartialEq,
U: AsRef<T>,
impl<'_, T: Beef + Send + ?Sized> Send for Cow<'_, T>
[src]
impl<'a, T: Beef + ?Sized + 'a> StructuralEq for Cow<'a, T>
[src]
impl<'_, T: Beef + Sync + ?Sized> Sync for Cow<'_, T>
[src]
Auto Trait Implementations
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,