Trait eso::borrow::Take[][src]

pub trait Take<O>: Sized {
    fn to_owned(&self) -> O;

    fn own(self) -> O { ... }
}
Expand description

A version of the ToOwned trait describing generalized references from which an owned form can be cloned.

The obvious instances for str, Path, OsStr, CStr, slices as well as sized types implementing Clone are implemented out of the box.

Required methods

fn to_owned(&self) -> O[src]

Clone the thing denoted by a generalized reference into one that is owned without consuming the reference.

Provided methods

fn own(self) -> O[src]

Clone the thing denoted by a generalized reference into one that is owned.

This trait function defaults to calling to_owned but is there as an optimization opportunity, if needed.

Implementations on Foreign Types

impl<'a> Take<OsString> for &'a [u8][src]

fn to_owned(&self) -> OsString[src]

impl<'a> Take<PathBuf> for &'a [u8][src]

fn to_owned(&self) -> PathBuf[src]

impl<'a> Take<String> for &'a str[src]

fn to_owned(&self) -> String[src]

impl<'a> Take<PathBuf> for &'a Path[src]

fn to_owned(&self) -> PathBuf[src]

impl<'a, T: Clone> Take<Vec<T, Global>> for &'a [T][src]

fn to_owned(&self) -> Vec<T>[src]

impl<'a> Take<OsString> for &'a OsStr[src]

fn to_owned(&self) -> OsString[src]

impl<'a> Take<PathBuf> for &'a OsStr[src]

fn to_owned(&self) -> PathBuf[src]

impl<'a, T: Clone> Take<T> for &'a T[src]

fn to_owned(&self) -> T[src]

impl<'a> Take<CString> for &'a CStr[src]

fn to_owned(&self) -> CString[src]

impl<'a, T: Clone> Take<Box<T, Global>> for &'a T[src]

fn to_owned(&self) -> Box<T>[src]

impl<'a, T: Clone> Take<Rc<T>> for &'a T[src]

fn to_owned(&self) -> Rc<T>[src]

impl<'a, T: Clone> Take<Arc<T>> for &'a T[src]

fn to_owned(&self) -> Arc<T>[src]

impl<'a, R: ToOwned> Take<<R as ToOwned>::Owned> for Cow<'a, R>[src]

fn to_owned(&self) -> R::Owned[src]

Implementors