[][src]Trait as_is::AsIs

pub trait AsIs: Sized {
    type Is: ?Sized + ToOwned;
    fn as_is<'a>(self) -> Is<'a, Self::Is>
    where
        Self: 'a
; fn into_is_cow<'a>(self) -> IsCow<'a, Self::Is>
    where
        Self: 'a
, { ... }
fn into_is_mut<'a>(self) -> IsMut<'a, Self::Is>
    where
        Self: 'a,
        Owned<Self>: BorrowMut<Self::Is>
, { ... }
fn into_owned(self) -> Owned<Self> { ... }
fn into_cow<'a>(self) -> Cow<'a, Self::Is>
    where
        Self: 'a
, { ... } }

Used to do a cheap conversion into Is<'a, T> in a generic context.

Associated Types

type Is: ?Sized + ToOwned

The base type associated with both owned and borrowed data.

Loading content...

Required methods

fn as_is<'a>(self) -> Is<'a, Self::Is> where
    Self: 'a, 

Converts self into an Is<'a, Self::Is>.

Loading content...

Provided methods

fn into_is_cow<'a>(self) -> IsCow<'a, Self::Is> where
    Self: 'a, 

Converts self into an IsCow<'a, Self::Is>.

fn into_is_mut<'a>(self) -> IsMut<'a, Self::Is> where
    Self: 'a,
    Owned<Self>: BorrowMut<Self::Is>, 

Converts self into an IsMut<'a, Self::Is>.

If self is neither an owned nor a mutably borrowed data, it creates an owned data by cloning.

fn into_owned(self) -> Owned<Self>

Converts self into an owned data.

If self is not an owned data, it creates an owned data by cloning.

fn into_cow<'a>(self) -> Cow<'a, Self::Is> where
    Self: 'a, 

Converts self into a Cow<'a, Self::Is>.

Loading content...

Implementations on Foreign Types

impl AsIs for i8[src]

type Is = Self

impl AsIs for i16[src]

type Is = Self

impl AsIs for i32[src]

type Is = Self

impl AsIs for i64[src]

type Is = Self

impl AsIs for i128[src]

type Is = Self

impl AsIs for isize[src]

type Is = Self

impl AsIs for u8[src]

type Is = Self

impl AsIs for u16[src]

type Is = Self

impl AsIs for u32[src]

type Is = Self

impl AsIs for u64[src]

type Is = Self

impl AsIs for u128[src]

type Is = Self

impl AsIs for usize[src]

type Is = Self

impl AsIs for f32[src]

type Is = Self

impl AsIs for f64[src]

type Is = Self

impl AsIs for bool[src]

type Is = Self

impl AsIs for String[src]

type Is = Self

impl<T> AsIs for Vec<T> where
    T: Clone
[src]

type Is = Self

impl<B: ?Sized, '_> AsIs for Cow<'_, B> where
    B: ToOwned
[src]

type Is = B

impl<T: ?Sized, '_> AsIs for &'_ T where
    T: ToOwned,
    T::Owned: IsOwned
[src]

type Is = T

impl<T: ?Sized, '_> AsIs for &'_ mut T where
    T: ToOwned,
    T::Owned: IsOwned
[src]

type Is = T

Loading content...

Implementors

impl<T: ?Sized, '_> AsIs for Is<'_, T> where
    T: ToOwned
[src]

type Is = T

impl<T: ?Sized, '_> AsIs for IsCow<'_, T> where
    T: ToOwned
[src]

type Is = T

impl<T: ?Sized, '_> AsIs for IsMut<'_, T> where
    T: ToOwned,
    T::Owned: BorrowMut<T>, 
[src]

type Is = T

Loading content...