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.

See also Slice for const methods.

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>