Trait ArrayConvertible

Source
pub trait ArrayConvertible<T, const N: usize> {
    // Required methods
    fn to_array(&self) -> [T; N];
    fn from_array(arr: [T; N]) -> Self;
}
Expand description

Trait for objects that can be converted to/from arrays

Required Methods§

Source

fn to_array(&self) -> [T; N]

Convert to array

Source

fn from_array(arr: [T; N]) -> Self

Create from 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.

Implementors§