generic_array::sequence

Trait Split

Source
pub unsafe trait Split<T, K: ArrayLength>: GenericSequence<T> {
    type First: GenericSequence<T>;
    type Second: GenericSequence<T>;

    // Required method
    fn split(self) -> (Self::First, Self::Second);
}
Expand description

Defines a GenericSequence that can be split into two parts at a given pivot index.

§Safety

While the split method is marked safe, care must be taken when implementing it.

Required Associated Types§

Source

type First: GenericSequence<T>

First part of the resulting split array

Source

type Second: GenericSequence<T>

Second part of the resulting split array

Required Methods§

Source

fn split(self) -> (Self::First, Self::Second)

Splits an array at the given index, returning the separate parts of the array.

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.

Implementors§

Source§

impl<'a, T, N, K> Split<T, K> for &'a GenericArray<T, N>
where N: ArrayLength + Sub<K>, K: ArrayLength, Diff<N, K>: ArrayLength,

Source§

type First = &'a GenericArray<T, K>

Source§

type Second = &'a GenericArray<T, <N as Sub<K>>::Output>

Source§

impl<'a, T, N, K> Split<T, K> for &'a mut GenericArray<T, N>
where N: ArrayLength + Sub<K>, K: ArrayLength, Diff<N, K>: ArrayLength,

Source§

type First = &'a mut GenericArray<T, K>

Source§

type Second = &'a mut GenericArray<T, <N as Sub<K>>::Output>

Source§

impl<T, N, K> Split<T, K> for GenericArray<T, N>
where N: ArrayLength + Sub<K>, K: ArrayLength, Diff<N, K>: ArrayLength,