SplitPrefix

Trait SplitPrefix 

Source
pub trait SplitPrefix<N>
where Self: Sized,
{ type Prefix; // Required method fn split_prefix(self) -> Option<(Self::Prefix, Self)>; }
Expand description

Split off a number of elements from the beginning of the collection where the number is determined at compile time.

Required Associated Types§

Required Methods§

Source

fn split_prefix(self) -> Option<(Self::Prefix, Self)>

Split N items from the beginning of the collection.

Return None if there are not enough items.

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, T, N> SplitPrefix<N> for &'a [T]
where N: Unsigned + Array<T>, <N as Array<T>>::Array: 'a,

Source§

type Prefix = &'a <N as Array<T>>::Array

Source§

fn split_prefix(self) -> Option<(Self::Prefix, Self)>

Source§

impl<'a, T, N> SplitPrefix<N> for &'a mut [T]
where N: Unsigned + Array<T>, <N as Array<T>>::Array: 'a,

Source§

type Prefix = &'a mut <N as Array<T>>::Array

Source§

fn split_prefix(self) -> Option<(Self::Prefix, Self)>

Source§

impl<I, N> SplitPrefix<N> for Range<I>
where I: IntBound + Default + Copy + From<usize>, RangeFrom<I>: Iterator<Item = I>, N: Unsigned + Array<I>, <N as Array<I>>::Array: Default,

Source§

type Prefix = <N as Array<I>>::Array

Source§

fn split_prefix(self) -> Option<(Self::Prefix, Self)>

Source§

impl<S, T, N> SplitPrefix<N> for (S, T)
where S: SplitPrefix<N>, T: SplitPrefix<N>,

Source§

type Prefix = (<S as SplitPrefix<N>>::Prefix, <T as SplitPrefix<N>>::Prefix)

Source§

fn split_prefix(self) -> Option<(Self::Prefix, Self)>

Source§

impl<T, N> SplitPrefix<N> for Vec<T>
where N: Unsigned + Array<T>, <N as Array<T>>::Array: Default,

Source§

type Prefix = <N as Array<T>>::Array

Source§

fn split_prefix(self) -> Option<(Self::Prefix, Self)>

Implementors§

Source§

impl<S, M: Unsigned> SplitPrefix<M> for ChunkedN<S>
where S: SplitAt + Set,

Source§

impl<S, N, M> SplitPrefix<M> for UniChunked<S, U<N>>
where S: SplitPrefix<<N as Mul<M>>::Output> + Set, N: Unsigned + Mul<M> + Copy, M: Unsigned,

Source§

type Prefix = UniChunked<<S as SplitPrefix<<N as Mul<M>>::Output>>::Prefix, U<N>>

Source§

impl<S, O, N> SplitPrefix<N> for Chunked<S, O>

Source§

type Prefix = Chunked<S, O>