Struct intervals_rs::Interval [−][src]
pub struct Interval<T: Debug + Display + Clone + Hash + Eq + Ord + PartialEq + PartialOrd> { /* fields omitted */ }
Implementations
impl<T: Debug + Display + Clone + Hash + Eq + Ord + PartialEq + PartialOrd> Interval<T>[src]
impl<T: Debug + Display + Clone + Hash + Eq + Ord + PartialEq + PartialOrd> Interval<T>[src]pub fn and_more(lower: LimitValue<T>) -> Self[src]
pub fn closed(lower: LimitValue<T>, upper: LimitValue<T>) -> Self[src]
pub fn more_than(lower: LimitValue<T>) -> Self[src]
pub fn open(lower: LimitValue<T>, upper: LimitValue<T>) -> Self[src]
pub fn over(
lower: LimitValue<T>,
lower_included: bool,
upper: LimitValue<T>,
upper_included: bool
) -> Self[src]
lower: LimitValue<T>,
lower_included: bool,
upper: LimitValue<T>,
upper_included: bool
) -> Self
pub fn single_element(element: LimitValue<T>) -> Self[src]
pub fn under(upper: LimitValue<T>) -> Self[src]
pub fn up_to(upper: LimitValue<T>) -> Self[src]
pub fn complement_relative_to(&self, other: &Interval<T>) -> Vec<Interval<T>>[src]
pub fn covers(&self, other: &Interval<T>) -> bool[src]
pub fn covers(&self, other: &Interval<T>) -> bool[src]Verify that this interval completely encloses the specified interval other.
- params
- other: an
Interval
- other: an
- return:
truefor full comprehension,falseotherwise
pub fn gap(&self, other: &Interval<T>) -> Interval<T>[src]
pub fn gap(&self, other: &Interval<T>) -> Interval<T>[src]Get the interval that lies between this interval and the given interval other.
For example, the gap between [3, 5) and [10, 20) is [5, 19). If the two intervals have a common part, return an empty interval.
- params
- other: an interval to be compared
- return: gap interval
pub fn is_single_element(&self) -> bool[src]
pub fn is_single_element(&self) -> bool[src]Verify whether this interval is a single-element interval or not.
A single-element interval has both upper and lower limits, and also indicates that these limits are equal and not an open interval.
For example, 3 <= x < 3, 3 <= x <= 3, and 3 <= x <= 3.
- return:
trueif it’s a single element interval,falseotherwise
pub fn empty_of_same_type(&self) -> Interval<T>[src]
pub fn new_of_same_type(
&self,
lower: LimitValue<T>,
lower_closed: bool,
upper: LimitValue<T>,
upper_closed: bool
) -> Interval<T>[src]
&self,
lower: LimitValue<T>,
lower_closed: bool,
upper: LimitValue<T>,
upper_closed: bool
) -> Interval<T>
pub fn includes(&self, value: &LimitValue<T>) -> bool[src]
pub fn includes(&self, value: &LimitValue<T>) -> bool[src]Verify whether or not the specified value value is included in this interval.
- params
- value: an interval value
- return:
trueif included,falseotherwise
pub fn is_below(&self, value: &LimitValue<T>) -> bool[src]
pub fn is_below(&self, value: &LimitValue<T>) -> bool[src]Verify that the specified value value does not exceed the upper limit of this interval.
- params
- value: an interval value
- return:
trueif not exceeded,falseotherwise
pub fn is_above(&self, value: &LimitValue<T>) -> bool[src]
pub fn is_above(&self, value: &LimitValue<T>) -> bool[src]Verify that the specified value value does not exceed the lower limit of this interval.
- params
- value: an interval value
- return:
trueif not exceeded,falseotherwise
pub fn is_open(&self) -> bool[src]
pub fn is_open(&self) -> bool[src]Verify whether this interval is an open interval or not.
- return:
trueif it’s an open interval,falseotherwise (including half-open interval)
pub fn is_closed(&self) -> bool[src]
pub fn is_closed(&self) -> bool[src]Verify whether this interval is a closed interval or not.
- return:
trueif it’s a closed interval,falseotherwise (including half-open interval)
pub fn is_empty(&self) -> bool[src]
pub fn is_empty(&self) -> bool[src]Verify whether this interval is empty or not.
The interval is empty means that the upper and lower limits are the same value and the interval is open.
For example, a state like 3 < x < 3.
- return:
trueif it’s empty,falseotherwise.
pub fn new(lower: IntervalLimit<T>, upper: IntervalLimit<T>) -> Interval<T>[src]
pub fn new_with(
lower: LimitValue<T>,
is_lower_closed: bool,
upper: LimitValue<T>,
is_upper_closed: bool
) -> Interval<T>[src]
lower: LimitValue<T>,
is_lower_closed: bool,
upper: LimitValue<T>,
is_upper_closed: bool
) -> Interval<T>
pub fn intersect(&self, other: &Interval<T>) -> Interval<T>[src]
pub fn intersect(&self, other: &Interval<T>) -> Interval<T>[src]Return the product set (common part) of this interval and the given interval other.
If the common part does not exist, it returns an empty interval.
- params
- other: an interval to be compared
pub fn intersects(&self, other: &Interval<T>) -> bool[src]
pub fn intersects(&self, other: &Interval<T>) -> bool[src]Verify if there is a common part between this interval and the given interval other.
- params
- other: a target interval
- return:
trueif the common part exists,falseotherwise
pub fn as_upper_limit(&self) -> &LimitValue<T>[src]
pub fn as_lower_limit(&self) -> &LimitValue<T>[src]
pub fn has_upper_limit(&self) -> bool[src]
pub fn has_upper_limit(&self) -> bool[src]Get whether there is an upper limit or not.
Warning: This method is generally used for the purpose of displaying this value and for interaction with classes that are highly coupled to this class. Careless use of this method will unnecessarily increase the coupling between this class and the client-side class.
If you want to use this value for calculations,
-
find another appropriate method or add a new method to this class.
-
find another suitable method or consider adding a new method to this class.
-
return:
trueif upper limit is present,falseotherwise
pub fn has_lower_limit(&self) -> bool[src]
pub fn has_lower_limit(&self) -> bool[src]Get whether there is an lower limit or not.
Warning: This method is generally used for the purpose of displaying this value and for interaction with classes that are highly coupled to this class. Careless use of this method will unnecessarily increase the coupling between this class and the client-side class.
If you want to use this value for calculations,
-
find another appropriate method or add a new method to this class.
-
find another suitable method or consider adding a new method to this class.
-
return:
trueif lower limit is present,falseotherwise
pub fn includes_upper_limit(&self) -> bool[src]
pub fn includes_upper_limit(&self) -> bool[src]Get whether the upper limit is closed or not.
Warning: This method is generally used for the purpose of displaying this value and for interaction with classes that are highly coupled to this class. Careless use of this method will unnecessarily increase the coupling between this class and the client-side class.
If you want to use this value for calculations,
-
find another appropriate method or add a new method to this class.
-
find another suitable method or consider adding a new method to this class.
-
return: true
if the upper limit is closed,false` otherwise
pub fn includes_lower_limit(&self) -> bool[src]
pub fn greater_of_lower_limits<'a>(
&'a self,
other: &'a Interval<T>
) -> &'a LimitValue<T>[src]
&'a self,
other: &'a Interval<T>
) -> &'a LimitValue<T>
pub fn lesser_of_upper_limits<'a>(
&'a self,
other: &'a Interval<T>
) -> &'a LimitValue<T>[src]
&'a self,
other: &'a Interval<T>
) -> &'a LimitValue<T>
pub fn greater_of_lower_included_in_intersection(
&self,
other: &Interval<T>
) -> bool[src]
&self,
other: &Interval<T>
) -> bool
pub fn greater_of_lower_included_in_union(&self, other: &Interval<T>) -> bool[src]
pub fn lesser_of_upper_included_in_intersection(
&self,
other: &Interval<T>
) -> bool[src]
&self,
other: &Interval<T>
) -> bool
pub fn lesser_of_upper_included_in_union(&self, other: &Interval<T>) -> bool[src]
pub fn left_complement_relative_to(
&self,
other: &Interval<T>
) -> Option<Interval<T>>[src]
pub fn left_complement_relative_to(
&self,
other: &Interval<T>
) -> Option<Interval<T>>[src]この区間の下側補区間と与えた区間 other の共通部分を返す。
other 比較対象の区間
return この区間の下側の補区間と、与えた区間の共通部分。存在しない場合は None
pub fn right_complement_relative_to(
&self,
other: &Interval<T>
) -> Option<Interval<T>>[src]
&self,
other: &Interval<T>
) -> Option<Interval<T>>
Trait Implementations
impl<T: Clone + Debug + Display + Hash + Eq + Ord + PartialEq + PartialOrd> Clone for Interval<T>[src]
impl<T: Clone + Debug + Display + Hash + Eq + Ord + PartialEq + PartialOrd> Clone for Interval<T>[src]impl<T: Debug + Display + Clone + Hash + Eq + Ord + PartialEq + PartialOrd> Debug for Interval<T>[src]
impl<T: Debug + Display + Clone + Hash + Eq + Ord + PartialEq + PartialOrd> Debug for Interval<T>[src]impl<T: Debug + Display + Clone + Hash + Eq + Ord + PartialEq + PartialOrd> Display for Interval<T>[src]
impl<T: Debug + Display + Clone + Hash + Eq + Ord + PartialEq + PartialOrd> Display for Interval<T>[src]impl<T: Hash + Debug + Display + Clone + Eq + Ord + PartialEq + PartialOrd> Hash for Interval<T>[src]
impl<T: Hash + Debug + Display + Clone + Eq + Ord + PartialEq + PartialOrd> Hash for Interval<T>[src]impl<T: Debug + Display + Clone + Hash + Eq + Ord + PartialEq + PartialOrd> PartialEq<Interval<T>> for Interval<T>[src]
impl<T: Debug + Display + Clone + Hash + Eq + Ord + PartialEq + PartialOrd> PartialEq<Interval<T>> for Interval<T>[src]fn eq(&self, other: &Self) -> bool[src]
fn eq(&self, other: &Self) -> bool[src]Verify the identity of this interval and the given interval other.
It returns true if both intervals are empty, and false if only one of them is empty.
If both are single-element intervals, the limits that are single elements are compared with each other, and true is returned if they match.
If only one of them is a single-element interval, false is returned.
- param
- other: an interval to be compared
- return:
trueif they are identical,falseif they are not
impl<T: Eq + Debug + Display + Clone + Hash + Ord + PartialEq + PartialOrd> Eq for Interval<T>[src]
impl<T: Debug + Display + Clone + Hash + Eq + Ord + PartialEq + PartialOrd> StructuralEq for Interval<T>[src]
Auto Trait Implementations
impl<T> RefUnwindSafe for Interval<T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
impl<T> Send for Interval<T> where
T: Send,
T: Send,
impl<T> Sync for Interval<T> where
T: Sync,
T: Sync,
impl<T> Unpin for Interval<T> where
T: Unpin,
T: Unpin,
impl<T> UnwindSafe for Interval<T> where
T: UnwindSafe,
T: UnwindSafe,
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]pub fn borrow_mut(&mut self) -> &mut T[src]
pub fn borrow_mut(&mut self) -> &mut T[src]Mutably borrows from an owned value. Read more
impl<T> ToOwned for T where
T: Clone, [src]
impl<T> ToOwned for T where
T: Clone, [src]type Owned = T
type Owned = TThe resulting type after obtaining ownership.
pub fn to_owned(&self) -> T[src]
pub fn to_owned(&self) -> T[src]Creates owned data from borrowed data, usually by cloning. Read more
pub fn clone_into(&self, target: &mut T)[src]
pub fn clone_into(&self, target: &mut T)[src]🔬 This is a nightly-only experimental API. (toowned_clone_into)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more