Trait std::marker::DiscriminantKind[][src]

pub trait DiscriminantKind {
    type Discriminant: Clone + Copy + Debug + Eq + PartialEq<Self::Discriminant> + Hash + Send + Sync + Unpin;
}
🔬 This is a nightly-only experimental API. (discriminant_kind)

this trait is unlikely to ever be stabilized, use mem::discriminant instead

Expand description

编译器内部的 trait 用于指示枚举判别式的类型。

trait 会自动为每种类型实现,并且不会为 mem::Discriminant 添加任何保证。 在 DiscriminantKind::Discriminantmem::Discriminant 之间转换是未定义的行为。

Associated Types

🔬 This is a nightly-only experimental API. (discriminant_kind)

this trait is unlikely to ever be stabilized, use mem::discriminant instead

判别类型,必须满足 mem::Discriminant 要求的 trait bounds。

Implementors