[][src]Trait moveslice::Moveslice

pub trait Moveslice<T, R> {
    type Target;
    type Err;
    fn moveslice(&mut self, bounds: R, destination: Self::Target)
    where
        R: RangeBounds<usize>
;
fn try_moveslice(
        &mut self,
        bounds: R,
        destination: Self::Target
    ) -> Result<(), Self::Err>
    where
        R: RangeBounds<usize>
; }

A trait declaring the moveslice and try_moveslice functions. Used to implement the functions on all slices.

Associated Types

type Target

Specifies the type of the destination index.

type Err

Specifies the errors being returned.

Loading content...

Required methods

fn moveslice(&mut self, bounds: R, destination: Self::Target) where
    R: RangeBounds<usize>, 

Moves a slice within an array/slice around.

  • bounds - specifies the range of where the subslice is. Examples: 3..5, 5..=8
  • destination - specifies where the subslice should be moved to.

fn try_moveslice(
    &mut self,
    bounds: R,
    destination: Self::Target
) -> Result<(), Self::Err> where
    R: RangeBounds<usize>, 

Similar to moveslice, except it does not panic, returning a Result instead.

Loading content...

Implementors

impl<T: 'static, R, A> Moveslice<T, R> for A where
    A: AsMut<[T]>, 
[src]

Implements the moveslice functions on all slices.

type Target = usize

type Err = Error

Loading content...