pub struct ArrayChain<T, const N: usize> { /* private fields */ }
Implementations§
Source§impl<T, const N: usize> ArrayChain<T, N>
impl<T, const N: usize> ArrayChain<T, N>
pub fn new_uninit() -> ArrayChain<MaybeUninit<T>, N>
pub fn new_zeroed() -> ArrayChain<MaybeUninit<T>, N>
Source§impl<T, const N: usize> ArrayChain<MaybeUninit<T>, N>
impl<T, const N: usize> ArrayChain<MaybeUninit<T>, N>
Sourcepub unsafe fn assume_init(self) -> ArrayChain<T, N>
pub unsafe fn assume_init(self) -> ArrayChain<T, N>
Assumes all slots inside the array are initialised according to T
’s
requirements, and converts into an array of T
Note: this implementation is currently subpar, as it does fully copy self
into a new container using ptr::read
. We have to do this because, at the
time of writing:
transmute
is a bit too dumb, and is not able to prove[T; N]
and[MaybeUninit<T>; N]
are guaranteed to be equal sized, even though we can see and prove ittransmute_unchecked
is liketransmute
but without that compile time size check, but it is unstable, and according to a code comment will almost certainly never be stabilised (reasoning is that it’s too unsafe, too much power to give users :p, and to hopefully find other methods for doing things without it so that it isn’t needed)MaybeUninit::array_assume_init
is unstable (it internally makes use oftransmute_unchecked
)
We don’t know of any other option than to perform a ptr cast, then read from it.
§Safety
All slots in self
must be fully initialised with valid values of T
.
Trait Implementations§
Source§impl<T, const N: usize> AsChainInner<[T; N]> for ArrayChain<T, N>
impl<T, const N: usize> AsChainInner<[T; N]> for ArrayChain<T, N>
Source§impl<T, const N: usize> Chain for ArrayChain<T, N>
impl<T, const N: usize> Chain for ArrayChain<T, N>
Source§impl<T, const N: usize> Clone for ArrayChain<T, N>
impl<T, const N: usize> Clone for ArrayChain<T, N>
Source§impl<T, const N: usize> Debug for ArrayChain<T, N>
impl<T, const N: usize> Debug for ArrayChain<T, N>
Source§impl<T, const N: usize> Default for ArrayChain<T, N>
impl<T, const N: usize> Default for ArrayChain<T, N>
Source§impl<T, const N: usize> Display for ArrayChain<T, N>
impl<T, const N: usize> Display for ArrayChain<T, N>
Source§impl<T, const N: usize> From<&ArrayChain<T, N>> for [T; N]
impl<T, const N: usize> From<&ArrayChain<T, N>> for [T; N]
Source§fn from(chain: &ArrayChain<T, N>) -> Self
fn from(chain: &ArrayChain<T, N>) -> Self
Converts to this type from the input type.
Source§impl<T, const N: usize> From<&mut ArrayChain<T, N>> for [T; N]
impl<T, const N: usize> From<&mut ArrayChain<T, N>> for [T; N]
Source§fn from(chain: &mut ArrayChain<T, N>) -> Self
fn from(chain: &mut ArrayChain<T, N>) -> Self
Converts to this type from the input type.
Source§impl<T, const N: usize> From<ArrayChain<T, N>> for [T; N]
impl<T, const N: usize> From<ArrayChain<T, N>> for [T; N]
Source§fn from(chain: ArrayChain<T, N>) -> Self
fn from(chain: ArrayChain<T, N>) -> Self
Converts to this type from the input type.
Source§impl<T, const N: usize> PartialEq<ArrayChain<T, N>> for [T; N]
impl<T, const N: usize> PartialEq<ArrayChain<T, N>> for [T; N]
Source§fn eq(&self, other: &ArrayChain<T, N>) -> bool
fn eq(&self, other: &ArrayChain<T, N>) -> bool
Tests for
self
and other
values to be equal, and is used by ==
.Source§fn ne(&self, other: &ArrayChain<T, N>) -> bool
fn ne(&self, other: &ArrayChain<T, N>) -> bool
Tests for
!=
. The default implementation is almost always sufficient,
and should not be overridden without very good reason.Source§impl<T, const N: usize> PartialEq for ArrayChain<T, N>
impl<T, const N: usize> PartialEq for ArrayChain<T, N>
Source§fn eq(&self, other: &ArrayChain<T, N>) -> bool
fn eq(&self, other: &ArrayChain<T, N>) -> bool
Tests for
self
and other
values to be equal, and is used by ==
.Source§fn ne(&self, other: &ArrayChain<T, N>) -> bool
fn ne(&self, other: &ArrayChain<T, N>) -> bool
Tests for
!=
. The default implementation is almost always sufficient,
and should not be overridden without very good reason.Source§impl<T, const N: usize> PartialOrd<[T; N]> for ArrayChain<T, N>
impl<T, const N: usize> PartialOrd<[T; N]> for ArrayChain<T, N>
Source§impl<T, const N: usize> PartialOrd<ArrayChain<T, N>> for [T; N]
impl<T, const N: usize> PartialOrd<ArrayChain<T, N>> for [T; N]
Source§fn partial_cmp(&self, other: &ArrayChain<T, N>) -> Option<Ordering>
fn partial_cmp(&self, other: &ArrayChain<T, N>) -> Option<Ordering>
Source§fn lt(&self, other: &ArrayChain<T, N>) -> bool
fn lt(&self, other: &ArrayChain<T, N>) -> bool
Source§fn le(&self, other: &ArrayChain<T, N>) -> bool
fn le(&self, other: &ArrayChain<T, N>) -> bool
Source§fn gt(&self, other: &ArrayChain<T, N>) -> bool
fn gt(&self, other: &ArrayChain<T, N>) -> bool
Source§impl<T, const N: usize> PartialOrd for ArrayChain<T, N>
impl<T, const N: usize> PartialOrd for ArrayChain<T, N>
Source§fn partial_cmp(&self, other: &ArrayChain<T, N>) -> Option<Ordering>
fn partial_cmp(&self, other: &ArrayChain<T, N>) -> Option<Ordering>
Source§fn lt(&self, other: &ArrayChain<T, N>) -> bool
fn lt(&self, other: &ArrayChain<T, N>) -> bool
Source§fn le(&self, other: &ArrayChain<T, N>) -> bool
fn le(&self, other: &ArrayChain<T, N>) -> bool
Source§fn gt(&self, other: &ArrayChain<T, N>) -> bool
fn gt(&self, other: &ArrayChain<T, N>) -> bool
impl<T, const N: usize> Copy for ArrayChain<T, N>
Auto Trait Implementations§
impl<T, const N: usize> Freeze for ArrayChain<T, N>where
T: Freeze,
impl<T, const N: usize> RefUnwindSafe for ArrayChain<T, N>where
T: RefUnwindSafe,
impl<T, const N: usize> Send for ArrayChain<T, N>where
T: Send,
impl<T, const N: usize> Sync for ArrayChain<T, N>where
T: Sync,
impl<T, const N: usize> Unpin for ArrayChain<T, N>where
T: Unpin,
impl<T, const N: usize> UnwindSafe for ArrayChain<T, N>where
T: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)