Trait slice_of_array::IsSliceomorphic [−][src]
Marker trait used in bounds of Slice{Flat,Nest,Array}Ext
.
This marks the array types approved for use with slice_of_array
.
It is deliberately not implemented for arrays of size 0,
because said traits are otherwise perfect isomorphisms for
the inputs that they don’t fail on;
Having .flat().nest()
turn a &[[i32; 0]]
of length 18
into a &[[i32; 0]]
of length 0 gives me the heebie jeebies.
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. (this use case is explicitly supported because the author does it himself, and quite frankly, it’s pretty convenient!)