Enum mixed_ref::MixedRef [] [src]

pub enum MixedRef<'a, T: ?Sized + 'a> {
    Owned(Box<T>),
    Borrowed(&'a T),
}

A reference to either owned or borrowed data.

If the data is owned, it's recommended to provide the 'static lifetime. In some cases, there's no other option.

If mutably borrowing data, use MixedRefMut.

Variants

Owned, boxed data.

Borrowed data.

Trait Implementations

impl<'a, T: Debug + ?Sized + 'a> Debug for MixedRef<'a, T>
[src]

Formats the value using the given formatter.

impl<'a, T: Eq + ?Sized + 'a> Eq for MixedRef<'a, T>
[src]

impl<'a, T: Hash + ?Sized + 'a> Hash for MixedRef<'a, T>
[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 + AsRef<U>, U: ?Sized + PartialEq> PartialEq<T> for MixedRef<'a, U>
[src]

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

This method tests for !=.

impl<'a, T: Default> Default for MixedRef<'a, T>
[src]

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

impl<'a, T: ?Sized> From<&'a T> for MixedRef<'a, T>
[src]

Performs the conversion.

impl<'a, T: ?Sized> From<Box<T>> for MixedRef<'a, T>
[src]

Performs the conversion.

impl<'a> From<String> for MixedRef<'a, str>
[src]

Performs the conversion.

impl<'a, T> From<Vec<T>> for MixedRef<'a, [T]>
[src]

Performs the conversion.

impl<'a, T: ?Sized> From<MixedRefMut<'a, T>> for MixedRef<'a, T>
[src]

Performs the conversion.

impl<'a, T: ?Sized> Deref for MixedRef<'a, T>
[src]

The resulting type after dereferencing

The method called to dereference a value

impl<'a, T: ?Sized> AsRef<T> for MixedRef<'a, T>
[src]

Performs the conversion.

impl<'a, T: ?Sized> Borrow<T> for MixedRef<'a, T>
[src]

Immutably borrows from an owned value. Read more