pub trait WrapperExt: Wrapper {
// Provided methods
fn replace(&mut self, value: Self::Item) -> Self::Item { ... }
fn set(&mut self, value: Self::Item) -> &mut Self { ... }
fn swap(&mut self, other: &mut Self) { ... }
fn take(&mut self) -> Self::Item
where Self::Item: Default { ... }
}Expand description
WrapperExt is an automatically implemented trait extending the Wrapper trait with
additional
Provided Methods§
Sourcefn replace(&mut self, value: Self::Item) -> Self::Item
fn replace(&mut self, value: Self::Item) -> Self::Item
replace replaces the value inside the wrapper with a new one,
returning the old value.
Sourcefn set(&mut self, value: Self::Item) -> &mut Self
fn set(&mut self, value: Self::Item) -> &mut Self
update the current value before returning a mutable reference to the wrapper
fn take(&mut self) -> Self::Item
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.