1
2
3
4
5
6
7
8
9
10
use crate::Protocol;

/// A trait for `enum`s with the `Protocol` trait.
pub trait EnumExt: Protocol {
    /// The type used to store the enum discriminant
    type Discriminant: Protocol;

    /// Gets the discriminant of the current variant.
    fn discriminant(&self) -> Self::Discriminant;
}