pub struct TimeRange {
pub start: Tick,
pub end: Tick,
}Expand description
A half-open span of ticks [start, end).
Fields§
§start: TickThe inclusive start tick of the range.
end: TickThe exclusive end tick of the range.
Implementations§
Source§impl TimeRange
impl TimeRange
Sourcepub fn new(start: Tick, end: Tick) -> Result<Self, MusicError>
pub fn new(start: Tick, end: Tick) -> Result<Self, MusicError>
Builds a range, quantizing end to start’s resolution.
Returns MusicError::InvalidTimeRange when end precedes start.
Sourcepub fn from_ticks(start: i64, end: i64, ppq: u32) -> Result<Self, MusicError>
pub fn from_ticks(start: i64, end: i64, ppq: u32) -> Result<Self, MusicError>
Builds a range from raw tick counts at the given pulses-per-quarter.
Returns MusicError::InvalidPpq when ppq is zero.
Sourcepub fn starts_at_zero(end: Tick) -> Result<Self, MusicError>
pub fn starts_at_zero(end: Tick) -> Result<Self, MusicError>
Builds a range from tick zero to end, sharing end’s resolution.
Trait Implementations§
impl Copy for TimeRange
impl Eq for TimeRange
impl StructuralPartialEq for TimeRange
Auto Trait Implementations§
impl Freeze for TimeRange
impl RefUnwindSafe for TimeRange
impl Send for TimeRange
impl Sync for TimeRange
impl Unpin for TimeRange
impl UnsafeUnpin for TimeRange
impl UnwindSafe for TimeRange
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