pub trait ArrayReformulate<T, const N: usize>: Array + AsSlice<Item = T> {
// Required methods
const fn reformulate<const M: usize>(self) -> [T; M]
where [(); { _ }]:;
const fn reformulate_ref<const M: usize>(&self) -> &[T; M]
where [(); { _ }]:;
const fn reformulate_mut<const M: usize>(&mut self) -> &mut [T; M]
where [(); { _ }]:;
const fn reformulate_pin_ref<const M: usize>(
self: Pin<&Self>,
) -> Pin<&[T; M]>
where [(); { _ }]:;
const fn reformulate_pin_mut<const M: usize>(
self: Pin<&mut Self>,
) -> Pin<&mut [T; M]>
where [(); { _ }]:;
const fn try_reformulate<const M: usize>(self) -> Result<[T; M], [T; N]>;
const fn try_reformulate_ref<const M: usize>(&self) -> Option<&[T; M]>;
const fn try_reformulate_mut<const M: usize>(
&mut self,
) -> Option<&mut [T; M]>;
const fn try_reformulate_pin_ref<const M: usize>(
self: Pin<&Self>,
) -> Option<Pin<&[T; M]>>;
const fn try_reformulate_pin_mut<const M: usize>(
self: Pin<&mut Self>,
) -> Option<Pin<&mut [T; M]>>;
}
Required Methods§
const fn reformulate<const M: usize>(self) -> [T; M]
const fn reformulate_ref<const M: usize>(&self) -> &[T; M]
const fn reformulate_mut<const M: usize>(&mut self) -> &mut [T; M]
const fn reformulate_pin_ref<const M: usize>(self: Pin<&Self>) -> Pin<&[T; M]>
const fn reformulate_pin_mut<const M: usize>( self: Pin<&mut Self>, ) -> Pin<&mut [T; M]>
const fn try_reformulate<const M: usize>(self) -> Result<[T; M], [T; N]>
const fn try_reformulate_ref<const M: usize>(&self) -> Option<&[T; M]>
const fn try_reformulate_mut<const M: usize>(&mut self) -> Option<&mut [T; M]>
const fn try_reformulate_pin_ref<const M: usize>( self: Pin<&Self>, ) -> Option<Pin<&[T; M]>>
const fn try_reformulate_pin_mut<const M: usize>( self: Pin<&mut Self>, ) -> Option<Pin<&mut [T; M]>>
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.