Skip to main content

ArrayExt

Trait ArrayExt 

Source
pub trait ArrayExt<const N: usize> {
    // Required methods
    fn split_array_ref_stable<const M: usize>(&self) -> (&[u8; M], &[u8]);
    fn rsplit_array_ref_stable<const M: usize>(&self) -> (&[u8], &[u8; M]);
}
Expand description

Copies of nightly-only functions for [u8; N].

Required Methods§

Source

fn split_array_ref_stable<const M: usize>(&self) -> (&[u8; M], &[u8])

Divides one array reference into two at an index.

The first will contain all indices from [0, M) (excluding the index M itself) and the second will contain all indices from [M, N) (excluding the index N itself).

Source

fn rsplit_array_ref_stable<const M: usize>(&self) -> (&[u8], &[u8; M])

Divides one array reference into two at an index from the end.

The first will contain all indices from [0, N - M) (excluding the index N - M itself) and the second will contain all indices from [N - M, N) (excluding the index N itself).

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<const N: usize> ArrayExt<N> for [u8; N]

Source§

fn split_array_ref_stable<const M: usize>(&self) -> (&[u8; M], &[u8])

Source§

fn rsplit_array_ref_stable<const M: usize>(&self) -> (&[u8], &[u8; M])

Implementors§