Struct interval_set::interval_set::Interval
[−]
[src]
pub struct Interval(_, _);
Struct Interval
containing two values representing the limit of the interval.
The Interval
is incluse which means that Interval(0, 10)
is [0, 10].
The value 0 is supposed to be equals or greater than the second value.
Methods
impl Interval
[src]
fn new(begin: u32, end: u32) -> Interval
fn whole() -> Interval
Return the maximum interval possible (with u32 var)
fn range_size(&self) -> u32
Because the trait Order is needed to sort the IntervalSet I dont what to change the
native order. This function coud be considered as the len
of the interval.
fn as_tuple(&self) -> (u32, u32)
Simply return an equivalent interval as tuple.
fn get_inf(&self) -> u32
I am not sure about those two function, maybe set the field as public could be a better idea...
fn get_sup(&self) -> u32
fn is_valid(&self) -> bool
Utility function check if the interval is valid.
Examples
The following intervals are valids:
use interval_set::Interval; Interval::new(0, 0); Interval::new(10, 100);
The following intervals ae not valid:
use interval_set::Interval; Interval::new(10, 0);
Trait Implementations
impl Clone for Interval
[src]
fn clone(&self) -> Interval
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl Debug for Interval
[src]
impl Eq for Interval
[src]
impl PartialEq for Interval
[src]
fn eq(&self, __arg_0: &Interval) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Interval) -> bool
This method tests for !=
.
impl PartialOrd for Interval
[src]
fn partial_cmp(&self, __arg_0: &Interval) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
fn lt(&self, __arg_0: &Interval) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
fn le(&self, __arg_0: &Interval) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
fn gt(&self, __arg_0: &Interval) -> bool
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
fn ge(&self, __arg_0: &Interval) -> bool
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
impl Ord for Interval
[src]
fn cmp(&self, __arg_0: &Interval) -> Ordering
This method returns an Ordering
between self
and other
. Read more
impl ToIntervalSet for Interval
[src]
fn to_interval_set(self) -> IntervalSet
Convert a simple interval into an intervalset. Note that the validity of the interval is checked.