Skip to main content

SwappableVectorViewMut

Trait SwappableVectorViewMut 

Source
pub trait SwappableVectorViewMut<T: ?Sized>: VectorViewMut<T> {
    // Required method
    fn swap(&mut self, i: usize, j: usize);
}
Expand description

A trait for VectorViewMuts that support swapping of two elements.

Since VectorViewMut is not necessarily able to return two mutable references to different entries, supporting swapping is indeed a stronger property than just being a VectorViewMut.

Required Methods§

Source

fn swap(&mut self, i: usize, j: usize)

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<T, A: Allocator> SwappableVectorViewMut<T> for Vec<T, A>

Source§

fn swap(&mut self, i: usize, j: usize)

Source§

impl<T, const N: usize> SwappableVectorViewMut<T> for [T; N]

Source§

fn swap(&mut self, i: usize, j: usize)

Source§

impl<T: ?Sized, V: ?Sized + SwappableVectorViewMut<T>> SwappableVectorViewMut<T> for &mut V

Source§

fn swap(&mut self, i: usize, j: usize)

Source§

impl<T> SwappableVectorViewMut<T> for [T]

Source§

fn swap(&mut self, i: usize, j: usize)

Implementors§

Source§

impl<'a, V, T> SwappableVectorViewMut<T> for ColumnMut<'a, V, T>
where V: AsPointerToSlice<T>,

Source§

impl<V: SwappableVectorViewMut<T>, T: ?Sized, U: ?Sized, F_const: for<'a> Fn(&'a T) -> &'a U, F_mut: for<'a> FnMut(&'a mut T) -> &'a mut U> SwappableVectorViewMut<U> for VectorViewMapMut<V, T, U, F_const, F_mut>

Source§

impl<V: SwappableVectorViewMut<T>, T: ?Sized> SwappableVectorViewMut<T> for StepBy<V, T>

Source§

impl<V: SwappableVectorViewMut<T>, T: ?Sized> SwappableVectorViewMut<T> for SubvectorView<V, T>