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 [(); { _ }]:;
fn split_arr_mut<const LEFT: usize>(
&mut self,
) -> (&mut Self::Output<LEFT>, &mut Self::Output<{ _ }>)
where [(); { _ }]:;
}
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
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.