pub struct IntervalCollection<T> {
pub elts: Vec<Interval<T>>,
}Expand description
A collection of disjoint intervals (gaps allowed).
Represents a union of non-overlapping intervals, which can have gaps between them. This is the result of combining, intersecting, or subtracting intervals. The collection is typically kept in sorted order for efficient operations.
§Fields
elts: Vector of disjoint intervals in order
§Examples
ⓘ
use thrust::intervals::Interval;
// Two non-adjacent flight level bands (with gap)
let band1 = Interval { start: 250, stop: 350 };
let band2 = Interval { start: 450, stop: 550 };
let collection = band1 + band2; // Results in IntervalCollection with gap [350–450]
// Calculate total time covered
let total = collection.total_duration();Fields§
§elts: Vec<Interval<T>>Implementations§
Source§impl<T, Delta> IntervalCollection<T>
impl<T, Delta> IntervalCollection<T>
pub fn total_duration(&self) -> Delta
Trait Implementations§
Source§impl<T> Add<&Interval<T>> for &IntervalCollection<T>
impl<T> Add<&Interval<T>> for &IntervalCollection<T>
Source§type Output = IntervalCollection<T>
type Output = IntervalCollection<T>
The resulting type after applying the
+ operator.Source§impl<T> Add<&Interval<T>> for IntervalCollection<T>
impl<T> Add<&Interval<T>> for IntervalCollection<T>
Source§type Output = IntervalCollection<T>
type Output = IntervalCollection<T>
The resulting type after applying the
+ operator.Source§impl<T> Add<&IntervalCollection<T>> for &Interval<T>
impl<T> Add<&IntervalCollection<T>> for &Interval<T>
Source§type Output = IntervalCollection<T>
type Output = IntervalCollection<T>
The resulting type after applying the
+ operator.Source§fn add(self, other: &IntervalCollection<T>) -> IntervalCollection<T>
fn add(self, other: &IntervalCollection<T>) -> IntervalCollection<T>
Performs the
+ operation. Read moreSource§impl<T> Add<Interval<T>> for IntervalCollection<T>
impl<T> Add<Interval<T>> for IntervalCollection<T>
Source§type Output = IntervalCollection<T>
type Output = IntervalCollection<T>
The resulting type after applying the
+ operator.Source§impl<T> Add<IntervalCollection<T>> for &Interval<T>
impl<T> Add<IntervalCollection<T>> for &Interval<T>
Source§type Output = IntervalCollection<T>
type Output = IntervalCollection<T>
The resulting type after applying the
+ operator.Source§fn add(self, other: IntervalCollection<T>) -> IntervalCollection<T>
fn add(self, other: IntervalCollection<T>) -> IntervalCollection<T>
Performs the
+ operation. Read moreSource§impl<T> Add for &IntervalCollection<T>
impl<T> Add for &IntervalCollection<T>
Source§type Output = IntervalCollection<T>
type Output = IntervalCollection<T>
The resulting type after applying the
+ operator.Source§fn add(self, other: &IntervalCollection<T>) -> IntervalCollection<T>
fn add(self, other: &IntervalCollection<T>) -> IntervalCollection<T>
Performs the
+ operation. Read moreSource§impl<T> Add for IntervalCollection<T>
impl<T> Add for IntervalCollection<T>
Source§type Output = IntervalCollection<T>
type Output = IntervalCollection<T>
The resulting type after applying the
+ operator.Source§fn add(self, other: IntervalCollection<T>) -> IntervalCollection<T>
fn add(self, other: IntervalCollection<T>) -> IntervalCollection<T>
Performs the
+ operation. Read moreSource§impl<T> BitAnd<&Interval<T>> for &IntervalCollection<T>
impl<T> BitAnd<&Interval<T>> for &IntervalCollection<T>
Source§type Output = IntervalCollection<T>
type Output = IntervalCollection<T>
The resulting type after applying the
& operator.Source§impl<T> BitAnd<&IntervalCollection<T>> for &Interval<T>
impl<T> BitAnd<&IntervalCollection<T>> for &Interval<T>
Source§type Output = IntervalCollection<T>
type Output = IntervalCollection<T>
The resulting type after applying the
& operator.Source§fn bitand(self, other: &IntervalCollection<T>) -> IntervalCollection<T>
fn bitand(self, other: &IntervalCollection<T>) -> IntervalCollection<T>
Performs the
& operation. Read moreSource§impl<T> BitAnd for &IntervalCollection<T>
impl<T> BitAnd for &IntervalCollection<T>
Source§type Output = IntervalCollection<T>
type Output = IntervalCollection<T>
The resulting type after applying the
& operator.Source§fn bitand(self, other: &IntervalCollection<T>) -> IntervalCollection<T>
fn bitand(self, other: &IntervalCollection<T>) -> IntervalCollection<T>
Performs the
& operation. Read moreSource§impl<T: Debug> Debug for IntervalCollection<T>
impl<T: Debug> Debug for IntervalCollection<T>
Source§impl<T> Display for &IntervalCollection<T>where
T: Display,
impl<T> Display for &IntervalCollection<T>where
T: Display,
Source§impl<T, Delta> Sub<Interval<T>> for IntervalCollection<T>
impl<T, Delta> Sub<Interval<T>> for IntervalCollection<T>
Source§type Output = IntervalCollection<T>
type Output = IntervalCollection<T>
The resulting type after applying the
- operator.Source§impl<T, Delta> Sub for IntervalCollection<T>
impl<T, Delta> Sub for IntervalCollection<T>
Source§type Output = IntervalCollection<T>
type Output = IntervalCollection<T>
The resulting type after applying the
- operator.Source§fn sub(self, other: IntervalCollection<T>) -> IntervalCollection<T>
fn sub(self, other: IntervalCollection<T>) -> IntervalCollection<T>
Performs the
- operation. Read moreAuto Trait Implementations§
impl<T> Freeze for IntervalCollection<T>
impl<T> RefUnwindSafe for IntervalCollection<T>where
T: RefUnwindSafe,
impl<T> Send for IntervalCollection<T>where
T: Send,
impl<T> Sync for IntervalCollection<T>where
T: Sync,
impl<T> Unpin for IntervalCollection<T>where
T: Unpin,
impl<T> UnsafeUnpin for IntervalCollection<T>
impl<T> UnwindSafe for IntervalCollection<T>where
T: 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