pub enum Interval<A, C> {
Lower {
below: A,
class: C,
},
Range {
from: A,
below: A,
class: C,
},
Upper {
from: A,
class: C,
},
Infinite {
class: C,
},
}
Expand description
An interval represents a mapping from a range of values of type A
, to a class, C
.
§Examples
use oner_quantize::Interval;
let interval = Interval::lower(100, "true");
assert_eq!(interval.matches(25), true);
assert_eq!(interval.matches(100), false);
assert_eq!(interval.matches(125), false);
Variants§
Lower
A lower bound, such as < 100
Range
A half-open exclusive range, such as >= 100 and < 200
aka [100,200)
Upper
An upper range, such as >= 200
Infinite
The interval that covers all values
Fields
§
class: C
Implementations§
Trait Implementations§
impl<A: Copy, C: Copy> Copy for Interval<A, C>
impl<A, C> StructuralPartialEq for Interval<A, C>
Auto Trait Implementations§
impl<A, C> Freeze for Interval<A, C>
impl<A, C> RefUnwindSafe for Interval<A, C>where
A: RefUnwindSafe,
C: RefUnwindSafe,
impl<A, C> Send for Interval<A, C>
impl<A, C> Sync for Interval<A, C>
impl<A, C> Unpin for Interval<A, C>
impl<A, C> UnwindSafe for Interval<A, C>where
A: UnwindSafe,
C: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more