pub enum MaybeBorrowed<'a, T> {
Borrowed(&'a T),
Owned(T),
}
Expand description
A value that is either borrowed or owned.
This is similar to std::borrow::Cow
, but does not require the ability to convert from
borrowed to owned.
Converts this type into a shared reference of the (usually inferred) input type.
Formats the value using the given formatter.
Read more
The resulting type after dereferencing.
Dereferences the value.
Immutably borrows from an owned value.
Read more
Mutably borrows from an owned value.
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.