[][src]Enum into_owned::Is

pub enum Is<'a, T> where
    T: Owned
{ Owned(T), Borrowed(&'a T), MutBorrowed(&'a mut T), }

Represents an owned value, an immutably borrowed reference, or a mutably borrowed reference.

Is<'a, T> is similar to Cow<'a, B>. Unlike Cow<'a, B>, it can hold a mutably borrowed reference. This enum can be created by the as_is method on IntoOwned.

This enum, as a clone-on-write smart pointer, is highly experimental. Most parts are subject to change. Especially, more traits (e.g. from core::ops) will be implemented.

Variants

Owned(T)
Borrowed(&'a T)
MutBorrowed(&'a mut T)

Implementations

impl<'_, T> Is<'_, T> where
    T: Owned
[src]

pub fn to_mut(&mut self) -> &mut T where
    T: Clone
[src]

Trait Implementations

impl<'_, T, U> AsRef<U> for Is<'_, T> where
    T: Owned + AsRef<U>,
    U: ?Sized
[src]

impl<'_, T> Binary for Is<'_, T> where
    T: Owned + Binary
[src]

impl<'_, T> Borrow<T> for Is<'_, T> where
    T: Owned
[src]

impl<'_, T> Clone for Is<'_, T> where
    T: Owned + Clone
[src]

impl<'a, T: Debug> Debug for Is<'a, T> where
    T: Owned
[src]

impl<'_, T> Default for Is<'_, T> where
    T: Owned + Default
[src]

fn default() -> Self[src]

Creates an owned Is<'a, T> with the default value of T.

impl<'_, T> Deref for Is<'_, T> where
    T: Owned
[src]

type Target = T

The resulting type after dereferencing.

impl<'_, T> Display for Is<'_, T> where
    T: Owned + Display
[src]

impl<'_, T> Eq for Is<'_, T> where
    T: Owned + Eq
[src]

impl<'_, T> Hash for Is<'_, T> where
    T: Owned + Hash
[src]

impl<'_, T> IntoOwned for Is<'_, T> where
    T: Owned
[src]

type Owned = T

The owned type associated with Self.

impl<'_, T> LowerExp for Is<'_, T> where
    T: Owned + LowerExp
[src]

impl<'_, T> LowerHex for Is<'_, T> where
    T: Owned + LowerHex
[src]

impl<'_, T> Octal for Is<'_, T> where
    T: Owned + Octal
[src]

impl<'_, T> Ord for Is<'_, T> where
    T: Owned + Ord
[src]

impl<'_, '_, T, U> PartialEq<Is<'_, U>> for Is<'_, T> where
    T: Owned + PartialEq<U>,
    U: Owned
[src]

impl<'_, '_, T, U> PartialOrd<Is<'_, U>> for Is<'_, T> where
    T: Owned + PartialOrd<U>,
    U: Owned
[src]

impl<'_, T> UpperExp for Is<'_, T> where
    T: Owned + UpperExp
[src]

impl<'_, T> UpperHex for Is<'_, T> where
    T: Owned + UpperHex
[src]

Auto Trait Implementations

impl<'a, T> RefUnwindSafe for Is<'a, T> where
    T: RefUnwindSafe

impl<'a, T> Send for Is<'a, T> where
    T: Send + Sync

impl<'a, T> Sync for Is<'a, T> where
    T: Sync

impl<'a, T> Unpin for Is<'a, T> where
    T: Unpin

impl<'a, T> !UnwindSafe for Is<'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.