1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
/// Chooses if price is flexible (i.e. it depends on some factor). #[derive(Debug, PartialEq, Eq, Clone, Copy, Hash)] pub enum Flexibility { /// The price is flexible. Flexible, /// The price is not flexible. Inflexible, } impl Flexibility { /// Checks if `self` is `Flexible`. pub fn is_flexible(self) -> bool { self == Flexibility::Flexible } /// Checks if `self` is `Inflexible`. pub fn is_inflexible(self) -> bool { self == Flexibility::Inflexible } }