Enum std::borrow::CowUnstable [-]  [+] [src]

pub enum Cow<'a, T, B: ToOwned<T> + 'a> {
    Borrowed(&'a B),
    Owned(T),
}

A clone-on-write smart pointer.

Variants

Borrowed

Borrowed data.

Owned

Owned data.

Methods

impl<'a, T, B: ToOwned<T>> Cow<'a, T, B>

fn to_mut(&mut self) -> &mut T

Acquire a mutable reference to the owned form of the data.

Copies the data if it is not already owned.

fn into_owned(self) -> T

Extract the owned data.

Copies the data if it is not already owned.

Trait Implementations

impl<'a, T, B: ToOwned<T>> Deref<B> for Cow<'a, T, B>

fn deref(&self) -> &B