devela::all

Trait ExtSliceMut

Source
pub trait ExtSliceMut<T>: ExtSlice<T> {
    // Required methods
    fn slice_lsplit_mut(&mut self, len: usize) -> &mut [T] ;
    fn slice_rsplit_mut(&mut self, len: usize) -> &mut [T] ;
    fn slice_msplit_left_mut(&mut self, len: usize) -> &mut [T] ;
    fn slice_msplit_right_mut(&mut self, len: usize) -> &mut [T] ;
}
Expand description

Extension trait providing additional methods for &mut [T].

This trait is sealed and cannot be implemented for any other type.

Required Methods§

Source

fn slice_lsplit_mut(&mut self, len: usize) -> &mut [T]

Returns a mutable left subslice of slice with the given maximum len.

If left_len > slice.len() it returns the full slice.

Source

fn slice_rsplit_mut(&mut self, len: usize) -> &mut [T]

Returns a mutable right subslice of slice with the given maximum len.

If left_len > slice.len() it returns the full slice.

Source

fn slice_msplit_left_mut(&mut self, len: usize) -> &mut [T]

Returns a mutable middle subslice of slice with the given maximum len and a left bias.

In case of a non-perfect middle split, it will have one character more on the left.

If len > slice.len() returns the full slice.

Source

fn slice_msplit_right_mut(&mut self, len: usize) -> &mut [T]

Returns a mutable middle subslice of slice with the given maximum len and a right bias.

In case of a non-perfect middle split, it will have one character more on the right.

If len > slice.len() returns the full slice.

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.

Implementations on Foreign Types§

Source§

impl<T> ExtSliceMut<T> for &mut [T]

Source§

fn slice_lsplit_mut(&mut self, len: usize) -> &mut [T]

Source§

fn slice_rsplit_mut(&mut self, len: usize) -> &mut [T]

Source§

fn slice_msplit_left_mut(&mut self, len: usize) -> &mut [T]

Source§

fn slice_msplit_right_mut(&mut self, len: usize) -> &mut [T]

Source§

impl<T> ExtSliceMut<T> for [T]

Source§

fn slice_lsplit_mut(&mut self, len: usize) -> &mut [T]

Source§

fn slice_rsplit_mut(&mut self, len: usize) -> &mut [T]

Source§

fn slice_msplit_left_mut(&mut self, len: usize) -> &mut [T]

Source§

fn slice_msplit_right_mut(&mut self, len: usize) -> &mut [T]

Source§

impl<T, const LEN: usize> ExtSliceMut<T> for [T; LEN]

Source§

fn slice_lsplit_mut(&mut self, len: usize) -> &mut [T]

Source§

fn slice_rsplit_mut(&mut self, len: usize) -> &mut [T]

Source§

fn slice_msplit_left_mut(&mut self, len: usize) -> &mut [T]

Source§

fn slice_msplit_right_mut(&mut self, len: usize) -> &mut [T]

Implementors§

Source§

impl<T> ExtSliceMut<T> for Vec<T>