pub struct Tier { /* private fields */ }Expand description
Represents an interval tier in a TextGrid.
Implementations§
Source§impl Tier
impl Tier
Sourcepub fn set_xmin<T: Into<Option<bool>>>(&mut self, xmin: f64, warn: T)
pub fn set_xmin<T: Into<Option<bool>>>(&mut self, xmin: f64, warn: T)
Sets the minimum x value for the interval tier.
§Arguments
xmin- The minimum x value to set.warn- Iftrue, displays a warning if the minimum point of any interval is greater thanxmin.
Sourcepub fn set_xmax<W: Into<Option<bool>>>(&mut self, xmax: f64, warn: W)
pub fn set_xmax<W: Into<Option<bool>>>(&mut self, xmax: f64, warn: W)
Sets the maximum x value for the interval tier.
§Arguments
xmax- The maximum x value to set.warn- Iftrue, displays a warning if the maximum point of any interval is less thanxmax.
Sourcepub fn push_interval<W: Into<Option<bool>>>(
&mut self,
interval: Interval,
warn: W,
)
pub fn push_interval<W: Into<Option<bool>>>( &mut self, interval: Interval, warn: W, )
Pushes an interval to the interval tier.
Calls reorder() to ensure the intervals are sorted by their minimum x value after pushing the interval.
§Arguments
interval- The interval to push.warn- IfSome(true), displays a warning if the minimum point of the interval is less than the minimum x value of the interval tier.
Sourcepub fn push_intervals<W: Into<Option<bool>> + Copy>(
&mut self,
intervals: Vec<Interval>,
warn: W,
)
pub fn push_intervals<W: Into<Option<bool>> + Copy>( &mut self, intervals: Vec<Interval>, warn: W, )
Pushes multiple intervals to the interval tier vector.
Calls reorder() afterwards to ensure the intervals are sorted by their minimum x value after pushing the intervals.
§Arguments
intervals- The intervals to push.warn- IfSome(true), displays a warning if the minimum point of any interval is less than the minimum x value of the interval tier.
Sourcepub fn set_intervals<W: Into<Option<bool>>>(
&mut self,
intervals: Vec<Interval>,
warn: W,
)
pub fn set_intervals<W: Into<Option<bool>>>( &mut self, intervals: Vec<Interval>, warn: W, )
Sets the intervals of the interval tier.
§Arguments
intervals- The intervals to set.warn- IfSome(true), displays a warning if any interval’s minimum point is less than the minimum x value of the interval tier or if any interval’s maximum point is greater than the maximum x value of the interval tier.
Sourcepub fn check_overlaps(&self) -> Option<Vec<(u64, u64)>>
pub fn check_overlaps(&self) -> Option<Vec<(u64, u64)>>
Checks for overlaps in the interval tier.
Calls reorder to ensure the intervals are sorted by their minimum x value before checking for overlaps.
§Returns
A vector of pairs of the overlapping intervals’ indices or None if there are no overlaps.
Sourcepub fn fix_boundaries<P: Into<Option<bool>> + Copy>(&mut self, prefer_first: P)
pub fn fix_boundaries<P: Into<Option<bool>> + Copy>(&mut self, prefer_first: P)
Fixes gaps/overlaps in the interval tier.
Calls reorder to ensure the intervals are sorted by their minimum x value before fixing gaps/overlaps.
§Arguments
prefer_first-trueby default. Iftrue, prefers the first interval in the case of a gap. Iffalse, prefers the second interval in the case of a gap.
§Panics
If the amount of intervals exceeds isize::MAX.