[][src]Struct beef::Cow

pub struct Cow<'a, T: Beef + ?Sized + 'a> { /* fields omitted */ }

A clone-on-write smart pointer, mostly compatible with std::borrow::Cow.

Methods

impl<'_, B: ?Sized> Cow<'_, B> where
    B: Beef
[src]

pub fn owned(val: B::Owned) -> Self[src]

Owned data.

impl<'a, T: ?Sized> Cow<'a, T> where
    T: Beef
[src]

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]

impl<'_, T: ?Sized> Borrow<T> for Cow<'_, T> where
    T: Beef
[src]

impl<'a, T: ?Sized> Clone for Cow<'a, T> where
    T: Beef
[src]

impl<'_, T: Beef + Debug + ?Sized> Debug for Cow<'_, T>[src]

impl<'_, T: ?Sized> Deref for Cow<'_, T> where
    T: Beef
[src]

type Target = T

The resulting type after dereferencing.

impl<'_, T: Beef + Display + ?Sized> Display for Cow<'_, T>[src]

impl<'_, T: ?Sized> Drop for Cow<'_, T> where
    T: Beef
[src]

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]

impl<'a, T: ?Sized> From<Cow<'a, T>> for Cow<'a, T> where
    T: Beef
[src]

impl<'a, T: ?Sized> From<Cow<'a, T>> for StdCow<'a, T> where
    T: Beef
[src]

impl<'_> From<String> for Cow<'_, str>[src]

impl<'_, T> From<Vec<T>> for Cow<'_, [T]> where
    T: Clone
[src]

impl<'_, T: ?Sized> Hash for Cow<'_, T> where
    T: Hash + Beef
[src]

impl<'_, T> PartialEq<Cow<'_, [T]>> for [T] where
    T: Clone + PartialEq,
    [T]: Beef
[src]

impl<'_, '_, T> PartialEq<Cow<'_, [T]>> for &'_ [T] where
    T: Clone + PartialEq,
    [T]: Beef
[src]

impl<'_, T> PartialEq<Cow<'_, [T]>> for Vec<T> where
    T: Clone + PartialEq,
    [T]: Beef
[src]

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]

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

impl<'a, T: ?Sized> Unpin for Cow<'a, T>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.