pub struct TimeRange { /* private fields */ }Expand description
A half-open time range with a non-negative duration.
Implementations§
Source§impl TimeRange
impl TimeRange
Sourcepub fn new(start: RationalTime, duration: RationalTime) -> Result<Self>
pub fn new(start: RationalTime, duration: RationalTime) -> Result<Self>
Creates a time range whose values use one rate.
§Errors
Returns ErrorKind::InvalidArgument when the duration is negative or
uses a different rate from the start.
Sourcepub const fn start(self) -> RationalTime
pub const fn start(self) -> RationalTime
Returns the inclusive start time.
Sourcepub const fn duration(self) -> RationalTime
pub const fn duration(self) -> RationalTime
Returns the non-negative duration.
Sourcepub fn end_exclusive(self) -> Result<RationalTime>
pub fn end_exclusive(self) -> Result<RationalTime>
Returns the exclusive end, checking integer overflow.
§Errors
Returns ErrorKind::InvalidArgument when start plus duration exceeds
the range of i64.
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