Trait SliceExt

Source
pub trait SliceExt: SliceExtSealed {
    type Inner;

    // Required methods
    fn is_sorted_by<F: FnMut(&Self::Inner, &Self::Inner) -> Ordering>(
        &self,
        f: F,
    ) -> bool;
    fn try_split_at(&self, k: usize) -> Option<(&Self, &Self)>;
    fn try_split_at_mut(&mut self, k: usize) -> Option<(&mut Self, &mut Self)>;
    unsafe fn split_at_unchecked(&self, k: usize) -> (&Self, &Self);
    unsafe fn split_at_unchecked_mut(
        &mut self,
        k: usize,
    ) -> (&mut Self, &mut Self);
    unsafe fn copy_from_ptr(&mut self, _: *const Self::Inner);
    fn copy_x(&mut self, s: usize, t: usize, n: usize)
       where Self::Inner: Copy;
    fn copy_from_x(&mut self, other: &Self)
       where Self::Inner: Copy;

    // Provided methods
    fn is_sorted(&self) -> bool
       where Self::Inner: Ord { ... }
    fn is_sorted_by_key<F: FnMut(&Self::Inner) -> K, K: Ord>(
        &self,
        f: F,
    ) -> bool { ... }
}

Required Associated Types§

Required Methods§

Source

fn is_sorted_by<F: FnMut(&Self::Inner, &Self::Inner) -> Ordering>( &self, f: F, ) -> bool

Source

fn try_split_at(&self, k: usize) -> Option<(&Self, &Self)>

Source

fn try_split_at_mut(&mut self, k: usize) -> Option<(&mut Self, &mut Self)>

Source

unsafe fn split_at_unchecked(&self, k: usize) -> (&Self, &Self)

Source

unsafe fn split_at_unchecked_mut(&mut self, k: usize) -> (&mut Self, &mut Self)

Source

unsafe fn copy_from_ptr(&mut self, _: *const Self::Inner)

Source

fn copy_x(&mut self, s: usize, t: usize, n: usize)
where Self::Inner: Copy,

Source

fn copy_from_x(&mut self, other: &Self)
where Self::Inner: Copy,

Provided Methods§

Source

fn is_sorted(&self) -> bool
where Self::Inner: Ord,

Source

fn is_sorted_by_key<F: FnMut(&Self::Inner) -> K, K: Ord>(&self, f: F) -> bool

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<A> SliceExt for [A]

Source§

type Inner = A

Source§

fn is_sorted_by<F: FnMut(&A, &A) -> Ordering>(&self, f: F) -> bool

Source§

fn try_split_at(&self, k: usize) -> Option<(&Self, &Self)>

Source§

fn try_split_at_mut(&mut self, k: usize) -> Option<(&mut Self, &mut Self)>

Source§

unsafe fn split_at_unchecked(&self, k: usize) -> (&Self, &Self)

Source§

unsafe fn split_at_unchecked_mut(&mut self, k: usize) -> (&mut Self, &mut Self)

Source§

unsafe fn copy_from_ptr(&mut self, ptr: *const Self::Inner)

Source§

fn copy_x(&mut self, s: usize, t: usize, n: usize)
where Self::Inner: Copy,

Source§

fn copy_from_x(&mut self, other: &Self)
where Self::Inner: Copy,

Implementors§