pub trait ExtractDiscriminant {
    type Discriminant: Clone + Copy + Debug + Eq + PartialEq + Hash + Send + Sync + Unpin + ComputeTypeSet;
}
Available on crate feature derive only.
Expand description

Helper trait to extract the core::marker::DiscriminantKind::Discriminant of a type and prove that it implements typeset::ComputeTypeSet and that its values can be represented by Discriminant.

Required Associated Types§

source

type Discriminant: Clone + Copy + Debug + Eq + PartialEq + Hash + Send + Sync + Unpin + ComputeTypeSet

The type of the discriminant, which must satisfy the trait bounds required by core::mem::Discriminant.

Enums implementing TypeLayout and typeset::ComputeTypeSet manually should include ExtractDiscriminant::Discriminant in their typeset::ComputeTypeSet::Output using the typeset::tset helper macro.

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<T> ExtractDiscriminant for T

§

type Discriminant = <T as ExtractDiscriminantSpec<<T as DiscriminantKind>::Discriminant>>::Ty