struct Replaceable<T>(Option<T>);
Expand description
Struct for safe in-place replacement.
This struct allows easily replacing struct fields that provide self -> Self
methods in-place,
without having to deal with constantly unwrapping the underlying Option
.
Replace the contents of the container.
Get immutable access to the wrapped value.
Get mutable access to the wrapped value.
The resulting type after dereferencing.
Dereferences the value.
Mutably 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.