Trait slice_of_array::IsSliceomorphic[][src]

pub unsafe trait IsSliceomorphic: Sized {
    type Element;

    const LEN: usize;
}

Marker trait used in bounds of Slice{Flat,Nest,Array}Ext.

This marks the array types approved for use with slice_of_array.

Safety

For any implementation, Self must have the same size and alignment as [Self::Element; Self::LEN]. Furthermore, you must be comfortable with the possibility of [Self] being reinterpreted bitwise as [[Self::Element; Self::LEN]] (or vice versa) in any possible context.

Notice

Please do NOT use this trait in public interfaces in your code.

slice_of_array is not yet 1.0, is not ready (or even designed) to be used as a public dependency.

However, feel free to implement this trait on your own private wrapper types around arrays and/or #[repr(C)] structs. (these use cases are explicitly supported because the author does it himself, and quite frankly, it’s pretty convenient!)

Associated Types

Loading content...

Associated Constants

Loading content...

Implementations on Foreign Types

impl<T, const N: usize> IsSliceomorphic for [T; N][src]

type Element = T

Loading content...

Implementors

Loading content...