moveit::new

Trait Swap

Source
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.

Required Methods§

Source

fn swap_with(self: Pin<&mut Self>, src: Pin<&mut Rhs>)

Swaps the contents of self and src without running any destructors.

Implementations on Foreign Types§

Source§

impl Swap for bool

Source§

fn swap_with(self: Pin<&mut Self>, that: Pin<&mut Self>)

Source§

impl Swap for char

Source§

fn swap_with(self: Pin<&mut Self>, that: Pin<&mut Self>)

Source§

impl Swap for i8

Source§

fn swap_with(self: Pin<&mut Self>, that: Pin<&mut Self>)

Source§

impl Swap for i16

Source§

fn swap_with(self: Pin<&mut Self>, that: Pin<&mut Self>)

Source§

impl Swap for i32

Source§

fn swap_with(self: Pin<&mut Self>, that: Pin<&mut Self>)

Source§

impl Swap for i64

Source§

fn swap_with(self: Pin<&mut Self>, that: Pin<&mut Self>)

Source§

impl Swap for i128

Source§

fn swap_with(self: Pin<&mut Self>, that: Pin<&mut Self>)

Source§

impl Swap for isize

Source§

fn swap_with(self: Pin<&mut Self>, that: Pin<&mut Self>)

Source§

impl Swap for u8

Source§

fn swap_with(self: Pin<&mut Self>, that: Pin<&mut Self>)

Source§

impl Swap for u16

Source§

fn swap_with(self: Pin<&mut Self>, that: Pin<&mut Self>)

Source§

impl Swap for u32

Source§

fn swap_with(self: Pin<&mut Self>, that: Pin<&mut Self>)

Source§

impl Swap for u64

Source§

fn swap_with(self: Pin<&mut Self>, that: Pin<&mut Self>)

Source§

impl Swap for u128

Source§

fn swap_with(self: Pin<&mut Self>, that: Pin<&mut Self>)

Source§

impl Swap for ()

Source§

fn swap_with(self: Pin<&mut Self>, that: Pin<&mut Self>)

Source§

impl Swap for usize

Source§

fn swap_with(self: Pin<&mut Self>, that: Pin<&mut Self>)

Source§

impl Swap for String

Source§

fn swap_with(self: Pin<&mut Self>, that: Pin<&mut Self>)

Source§

impl Swap for Layout

Source§

fn swap_with(self: Pin<&mut Self>, that: Pin<&mut Self>)

Source§

impl Swap for PhantomPinned

Source§

fn swap_with(self: Pin<&mut Self>, that: Pin<&mut Self>)

Source§

impl Swap for AtomicI8

Source§

fn swap_with(self: Pin<&mut Self>, that: Pin<&mut Self>)

Source§

impl Swap for AtomicI16

Source§

fn swap_with(self: Pin<&mut Self>, that: Pin<&mut Self>)

Source§

impl Swap for AtomicI32

Source§

fn swap_with(self: Pin<&mut Self>, that: Pin<&mut Self>)

Source§

impl Swap for AtomicI64

Source§

fn swap_with(self: Pin<&mut Self>, that: Pin<&mut Self>)

Source§

impl Swap for AtomicIsize

Source§

fn swap_with(self: Pin<&mut Self>, that: Pin<&mut Self>)

Source§

impl Swap for AtomicU8

Source§

fn swap_with(self: Pin<&mut Self>, that: Pin<&mut Self>)

Source§

impl Swap for AtomicU16

Source§

fn swap_with(self: Pin<&mut Self>, that: Pin<&mut Self>)

Source§

impl Swap for AtomicU32

Source§

fn swap_with(self: Pin<&mut Self>, that: Pin<&mut Self>)

Source§

impl Swap for AtomicU64

Source§

fn swap_with(self: Pin<&mut Self>, that: Pin<&mut Self>)

Source§

impl Swap for AtomicUsize

Source§

fn swap_with(self: Pin<&mut Self>, that: Pin<&mut Self>)

Source§

impl Swap for Duration

Source§

fn swap_with(self: Pin<&mut Self>, that: Pin<&mut Self>)

Source§

impl Swap for NonZeroI8

Source§

fn swap_with(self: Pin<&mut Self>, that: Pin<&mut Self>)

Source§

impl Swap for NonZeroI16

Source§

fn swap_with(self: Pin<&mut Self>, that: Pin<&mut Self>)

Source§

impl Swap for NonZeroI32

Source§

fn swap_with(self: Pin<&mut Self>, that: Pin<&mut Self>)

Source§

impl Swap for NonZeroI64

Source§

fn swap_with(self: Pin<&mut Self>, that: Pin<&mut Self>)

Source§

impl Swap for NonZeroI128

Source§

fn swap_with(self: Pin<&mut Self>, that: Pin<&mut Self>)

Source§

impl Swap for NonZeroIsize

Source§

fn swap_with(self: Pin<&mut Self>, that: Pin<&mut Self>)

Source§

impl Swap for NonZeroU8

Source§

fn swap_with(self: Pin<&mut Self>, that: Pin<&mut Self>)

Source§

impl Swap for NonZeroU16

Source§

fn swap_with(self: Pin<&mut Self>, that: Pin<&mut Self>)

Source§

impl Swap for NonZeroU32

Source§

fn swap_with(self: Pin<&mut Self>, that: Pin<&mut Self>)

Source§

impl Swap for NonZeroU64

Source§

fn swap_with(self: Pin<&mut Self>, that: Pin<&mut Self>)

Source§

impl Swap for NonZeroU128

Source§

fn swap_with(self: Pin<&mut Self>, that: Pin<&mut Self>)

Source§

impl Swap for NonZeroUsize

Source§

fn swap_with(self: Pin<&mut Self>, that: Pin<&mut Self>)

Source§

impl<K, V> Swap for BTreeMap<K, V>

Source§

fn swap_with(self: Pin<&mut Self>, that: Pin<&mut Self>)

Source§

impl<T> Swap for Option<T>

Source§

fn swap_with(self: Pin<&mut Self>, that: Pin<&mut Self>)

Source§

impl<T> Swap for Box<T>

Source§

fn swap_with(self: Pin<&mut Self>, that: Pin<&mut Self>)

Source§

impl<T> Swap for BinaryHeap<T>

Source§

fn swap_with(self: Pin<&mut Self>, that: Pin<&mut Self>)

Source§

impl<T> Swap for BTreeSet<T>

Source§

fn swap_with(self: Pin<&mut Self>, that: Pin<&mut Self>)

Source§

impl<T> Swap for LinkedList<T>

Source§

fn swap_with(self: Pin<&mut Self>, that: Pin<&mut Self>)

Source§

impl<T> Swap for VecDeque<T>

Source§

fn swap_with(self: Pin<&mut Self>, that: Pin<&mut Self>)

Source§

impl<T> Swap for Rc<T>

Source§

fn swap_with(self: Pin<&mut Self>, that: Pin<&mut Self>)

Source§

impl<T> Swap for Weak<T>

Source§

fn swap_with(self: Pin<&mut Self>, that: Pin<&mut Self>)

Source§

impl<T> Swap for Arc<T>

Source§

fn swap_with(self: Pin<&mut Self>, that: Pin<&mut Self>)

Source§

impl<T> Swap for Weak<T>

Source§

fn swap_with(self: Pin<&mut Self>, that: Pin<&mut Self>)

Source§

impl<T> Swap for Vec<T>

Source§

fn swap_with(self: Pin<&mut Self>, that: Pin<&mut Self>)

Source§

impl<T> Swap for Cell<T>

Source§

fn swap_with(self: Pin<&mut Self>, that: Pin<&mut Self>)

Source§

impl<T> Swap for Ref<'_, T>

Source§

fn swap_with(self: Pin<&mut Self>, that: Pin<&mut Self>)

Source§

impl<T> Swap for RefCell<T>

Source§

fn swap_with(self: Pin<&mut Self>, that: Pin<&mut Self>)

Source§

impl<T> Swap for RefMut<'_, T>

Source§

fn swap_with(self: Pin<&mut Self>, that: Pin<&mut Self>)

Source§

impl<T> Swap for UnsafeCell<T>

Source§

fn swap_with(self: Pin<&mut Self>, that: Pin<&mut Self>)

Source§

impl<T> Swap for ManuallyDrop<T>

Source§

fn swap_with(self: Pin<&mut Self>, that: Pin<&mut Self>)

Source§

impl<T> Swap for Discriminant<T>

Source§

fn swap_with(self: Pin<&mut Self>, that: Pin<&mut Self>)

Source§

impl<T> Swap for Wrapping<T>

Source§

fn swap_with(self: Pin<&mut Self>, that: Pin<&mut Self>)

Source§

impl<T> Swap for Pin<T>

Source§

fn swap_with(self: Pin<&mut Self>, that: Pin<&mut Self>)

Source§

impl<T> Swap for NonNull<T>

Source§

fn swap_with(self: Pin<&mut Self>, that: Pin<&mut Self>)

Source§

impl<T> Swap for AtomicPtr<T>

Source§

fn swap_with(self: Pin<&mut Self>, that: Pin<&mut Self>)

Source§

impl<T> Swap for MaybeUninit<T>

Source§

fn swap_with(self: Pin<&mut Self>, that: Pin<&mut Self>)

Source§

impl<T, E> Swap for Result<T, E>

Source§

fn swap_with(self: Pin<&mut Self>, that: Pin<&mut Self>)

Source§

impl<T: ?Sized> Swap for *const T

Source§

fn swap_with(self: Pin<&mut Self>, that: Pin<&mut Self>)

Source§

impl<T: ?Sized> Swap for *mut T

Source§

fn swap_with(self: Pin<&mut Self>, that: Pin<&mut Self>)

Source§

impl<T: ?Sized> Swap for &T

Source§

fn swap_with(self: Pin<&mut Self>, that: Pin<&mut Self>)

Source§

impl<T: ?Sized> Swap for &mut T

Source§

fn swap_with(self: Pin<&mut Self>, that: Pin<&mut Self>)

Source§

impl<T: ?Sized> Swap for PhantomData<T>

Source§

fn swap_with(self: Pin<&mut Self>, that: Pin<&mut Self>)

Implementors§