pub trait Takeable {
    // Required method
    fn take(&mut self) -> Self;
}
Expand description

Allows the implementor to be replaced by an empty value. The semantics is similar to core::mem::take, except that for some types it is not sensible to implement Default for the target type. This can be useful in state transitions, but replace_with might be a better choice.

Required Methods§

source

fn take(&mut self) -> Self

Replaces self with an implementor-defined “empty” value.

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<T: Default> Takeable for T