Trait narrow::array::union::EnumVariant

source ·
pub trait EnumVariant<const INDEX: usize>: Sized {
    type Data: ArrayType<Self::Data> + Default;

    // Required method
    fn from_data(value: Self::Data) -> Self;
}
Expand description

The array data for enum variants stored in union array wrappers.

Implementations provide the method to convert back to the original enum.

Required Associated Types§

source

type Data: ArrayType<Self::Data> + Default

The data for this variant. It must be an ArrayType because it is stored in an array. And it must implement Into<Self> (this is taking the data and wrapping it in the original enum variant).

Required Methods§

source

fn from_data(value: Self::Data) -> Self

Wraps the data in the original enum variant

Object Safety§

This trait is not object safe.

Implementors§