Trait split_array::SplitArray
source · pub trait SplitArray<const LEN: usize> {
type Output<const OUT_SIZE: usize>: SplitArray<OUT_SIZE>;
// Required methods
fn split_arr<const LEFT: usize>(
&self
) -> (&Self::Output<LEFT>, &Self::Output<{ _ }>)
where (): True<{ _ }>;
fn split_arr_mut<const LEFT: usize>(
&mut self
) -> (&mut Self::Output<LEFT>, &mut Self::Output<{ _ }>)
where (): True<{ _ }>;
}Expand description
Split array references in two with compile-time size validation.
Required Associated Types§
sourcetype Output<const OUT_SIZE: usize>: SplitArray<OUT_SIZE>
type Output<const OUT_SIZE: usize>: SplitArray<OUT_SIZE>
The result of a split.
Required Methods§
sourcefn split_arr<const LEFT: usize>(
&self
) -> (&Self::Output<LEFT>, &Self::Output<{ _ }>)
fn split_arr<const LEFT: usize>( &self ) -> (&Self::Output<LEFT>, &Self::Output<{ _ }>)
Split an array reference into a reference to the left half and a reference to the right half. The sizes of the halves are validated at compile time.
sourcefn split_arr_mut<const LEFT: usize>(
&mut self
) -> (&mut Self::Output<LEFT>, &mut Self::Output<{ _ }>)
fn split_arr_mut<const LEFT: usize>( &mut self ) -> (&mut Self::Output<LEFT>, &mut Self::Output<{ _ }>)
Mutable version of Self::split_arr
Object Safety§
This trait is not object safe.