pub enum RangeCase {
ExclusiveInt(Range<INT>, usize),
InclusiveInt(RangeInclusive<INT>, usize),
}
Expand description
(internals) A type containing a range case for a switch
statement.
Exported under the internals
feature only.
Variants§
ExclusiveInt(Range<INT>, usize)
Exclusive range.
InclusiveInt(RangeInclusive<INT>, usize)
Inclusive range.
Implementations§
source§impl RangeCase
impl RangeCase
sourcepub fn contains_int(&self, n: INT) -> bool
pub fn contains_int(&self, n: INT) -> bool
Is the specified number within this range?
sourcepub fn contains_float(&self, n: FLOAT) -> bool
pub fn contains_float(&self, n: FLOAT) -> bool
Is the specified floating-point number within this range?
sourcepub fn contains_decimal(&self, n: Decimal) -> bool
pub fn contains_decimal(&self, n: Decimal) -> bool
Is the specified decimal number within this range?
sourcepub const fn is_inclusive(&self) -> bool
pub const fn is_inclusive(&self) -> bool
Is the specified range inclusive?
sourcepub const fn index(&self) -> usize
pub const fn index(&self) -> usize
Get the index to the ConditionalExpr
.
sourcepub fn set_index(&mut self, index: usize)
pub fn set_index(&mut self, index: usize)
Set the index to the ConditionalExpr
.
Trait Implementations§
source§impl From<RangeInclusive<i64>> for RangeCase
impl From<RangeInclusive<i64>> for RangeCase
source§fn from(value: RangeInclusive<INT>) -> Self
fn from(value: RangeInclusive<INT>) -> Self
Converts to this type from the input type.