Trait IntoArray

Source
pub trait IntoArray: AsArray + IntoBoxedSlice {
    // Required method
    const fn into_array(self) -> [Self::Item; Self::LENGTH];
}

Required Methods§

Source

const fn into_array(self) -> [Self::Item; Self::LENGTH]

Returns self as an array

Useful in the case where a trait is implemented using a generic bound to the Array trait. In this case, the compiler does not automatically know that the type with the Array-trait is an actual array. This method lets you tell the compiler that you are now working with an actual array, and not just something which implements the trait 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.

Implementations on Foreign Types§

Source§

impl<Item, const LENGTH: usize> IntoArray for [Item; LENGTH]

Implementors§