Enum bow::Bow [] [src]

pub enum Bow<'a, T: 'a + ToBox + ?Sized> {
    Borrowed(&'a T),
    Boxed(Box<T>),
}

Like a Cow, using ToBox instead of ToBoxed.

Variants

Borrowed data.

Boxed data.

Methods

impl<'a, T: 'a + ToBox + ?Sized> Bow<'a, T>
[src]

Acquires a mutable reference to the data.

Boxes the data if it is not already boxed.

Extracts the data as a box.

Boxes the data if it is not already boxed.

Trait Implementations

impl<'a, T: ToBox + ?Sized> Clone for Bow<'a, T>
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl<'a, T: 'a + ToBox + ?Sized> Deref for Bow<'a, T>
[src]

The resulting type after dereferencing

The method called to dereference a value

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

Formats the value using the given formatter.

impl<'a, T: 'a + ToBox + Display + ?Sized> Display for Bow<'a, T>
[src]

Formats the value using the given formatter.

impl<T: 'static + ToBox + ?Sized> Default for Bow<'static, T> where &'static T: Default
[src]

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

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

Performs the conversion.

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

Performs the conversion.

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

Performs the conversion.