pub unsafe trait EnumSetTypeWithRepr: EnumSetType + EnumSetTypePrivate<Repr = Self::Repr> {
type Repr: EnumSetTypeRepr;
}
Expand description
An EnumSetType
for which EnumSet
s have a guaranteed in-memory representation.
An implementation of this trait is generated by using
#[derive(EnumSetType)]
with the annotation
#[enumset(repr = "…")]
, where …
is u8
, u16
, u32
, u64
or u128
.
For any type T
that implements this trait, the in-memory representation of EnumSet<T>
is guaranteed to be Repr
. This guarantee is useful for FFI. See the EnumSet
documentation
under “FFI, Safety and repr
” for an example.
Required Associated Types§
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.