bin-proto 0.12.7

Conversion to/from binary for arbitrary types
Documentation
1
2
3
4
5
6
7
8
9
10
/// A trait for types with discriminants. Automatically derived for `enum`s.
pub trait Discriminable {
    /// The type of the discriminant.
    type Discriminant;

    /// Returns a value uniquely identifying the variant.
    ///
    /// Returns [`None`] if the variant cannot be encoded.
    fn discriminant(&self) -> Option<Self::Discriminant>;
}