Enum mucow::MuCow [] [src]

pub enum MuCow<'a, B: ?Sized + 'a> where
    B: ToOwned
{ Borrowed(&'a mut B), Owned(<B as ToOwned>::Owned), }

A clone-on-consume smart pointer.

Variants

Borrowed data.

Owned data.

Methods

impl<'a, B: ?Sized> MuCow<'a, B> where
    B: ToOwned
[src]

Extracts the owned data.

Clones the data if it is not already owned.

Trait Implementations

impl<'a, B: ?Sized> Borrow<B> for MuCow<'a, B> where
    B: ToOwned,
    B::Owned: 'a, 
[src]

Immutably borrows from an owned value. Read more

impl<'a, B: ?Sized> BorrowMut<B> for MuCow<'a, B> where
    B: ToOwned,
    B::Owned: 'a + BorrowMut<B>, 
[src]

Mutably borrows from an owned value. Read more

impl<'a, B: ?Sized> Into<Cow<'a, B>> for MuCow<'a, B> where
    B: ToOwned
[src]

Performs the conversion.

impl<'a, B: ?Sized> Clone for MuCow<'a, B> where
    B: ToOwned
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl<'a, B: ?Sized> Deref for MuCow<'a, B> where
    B: ToOwned
[src]

The resulting type after dereferencing

The method called to dereference a value

impl<'a, B: ?Sized> DerefMut for MuCow<'a, B> where
    B: ToOwned,
    B::Owned: BorrowMut<B>, 
[src]

The method called to mutably dereference a value

impl<'a, B: ?Sized> Eq for MuCow<'a, B> where
    B: Eq + ToOwned
[src]

impl<'a, B: ?Sized> Ord for MuCow<'a, B> where
    B: Ord + ToOwned
[src]

This method returns an Ordering between self and other. Read more

impl<'a, 'b, B: ?Sized, C: ?Sized> PartialEq<MuCow<'b, C>> for MuCow<'a, B> where
    B: PartialEq<C> + ToOwned,
    C: ToOwned
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl<'a, B: ?Sized> PartialOrd for MuCow<'a, B> where
    B: PartialOrd + ToOwned
[src]

This method returns an ordering between self and other values if one exists. Read more

This method tests less than (for self and other) and is used by the < operator. Read more

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

This method tests greater than (for self and other) and is used by the > operator. Read more

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

impl<'a, B: ?Sized> Debug for MuCow<'a, B> where
    B: Debug + ToOwned,
    <B as ToOwned>::Owned: Debug
[src]

Formats the value using the given formatter.

impl<'a, B: ?Sized> Display for MuCow<'a, B> where
    B: Display + ToOwned,
    <B as ToOwned>::Owned: Display
[src]

Formats the value using the given formatter. Read more

impl<'a, B: ?Sized> Default for MuCow<'a, B> where
    B: ToOwned,
    <B as ToOwned>::Owned: Default
[src]

Returns the "default value" for a type. Read more

impl<'a, B: ?Sized> Hash for MuCow<'a, B> where
    B: Hash + ToOwned
[src]

Feeds this value into the given [Hasher]. Read more

Feeds a slice of this type into the given [Hasher]. Read more

impl<'a, T: ?Sized + ToOwned> AsRef<T> for MuCow<'a, T>
[src]

Performs the conversion.