Enum pfmt::BoxOrRef

source ·
pub enum BoxOrRef<'a, T: ?Sized + 'a> {
    Boxed(Box<T>),
    Ref(&'a T),
}
Expand description

A Cow without ToOwned.

Variants

Boxed(Box<T>)

Ref(&'a T)

Trait Implementations

Immutably borrows from an owned value. Read more
The resulting type after dereferencing.
Dereferences the value.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more
Perform the formatting of a single placeholder. Placeholder’s full name, name segments of child format units, arguments, flags and options will be passed to this method. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.