pub trait Swap<Rhs = Self> {
// Required method
fn swap_with(self: Pin<&mut Self>, src: Pin<&mut Rhs>);
}
Expand description
A swappable type, which is able to efficiently swap the contents of two of its values.
Unlike New
, Swap
is safe, because it does not impose any requirements
on the swapped pointers.
It is possible to implement swapping with a source type that isn’t Self
.