#[repr(C)]pub struct CMTimeRange {
pub start: CMTime,
pub duration: CMTime,
}Available on crate feature
cm only.Expand description
CMTimeRange representation matching Core Media’s CMTimeRange.
use apple_cf::cm::{CMTime, CMTimeRange};
let range = CMTimeRange::new(CMTime::new(0, 600), CMTime::new(300, 600));
assert_eq!(range.end(), CMTime::new(300, 600));
assert!(range.contains_time(CMTime::new(150, 600)));Fields§
§start: CMTime§duration: CMTimeImplementations§
Source§impl CMTimeRange
impl CMTimeRange
Sourcepub const fn new(start: CMTime, duration: CMTime) -> Self
pub const fn new(start: CMTime, duration: CMTime) -> Self
Creates a Core Media time range from a start time and duration.
Sourcepub const fn is_valid(&self) -> bool
pub const fn is_valid(&self) -> bool
Returns whether both the start and duration are valid CMTime values.
Sourcepub fn contains_time(&self, time: CMTime) -> bool
pub fn contains_time(&self, time: CMTime) -> bool
Returns whether this range contains the supplied CMTime.
Sourcepub fn contains_range(&self, other: Self) -> bool
pub fn contains_range(&self, other: Self) -> bool
Returns whether this range fully contains other.
Sourcepub fn intersection(&self, other: Self) -> Self
pub fn intersection(&self, other: Self) -> Self
Returns the intersection of this range and other.
Trait Implementations§
Source§impl Clone for CMTimeRange
impl Clone for CMTimeRange
Source§fn clone(&self) -> CMTimeRange
fn clone(&self) -> CMTimeRange
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CMTimeRange
impl Debug for CMTimeRange
Source§impl Display for CMTimeRange
impl Display for CMTimeRange
Source§impl Hash for CMTimeRange
impl Hash for CMTimeRange
Source§impl PartialEq for CMTimeRange
impl PartialEq for CMTimeRange
Source§fn eq(&self, other: &CMTimeRange) -> bool
fn eq(&self, other: &CMTimeRange) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Copy for CMTimeRange
impl Eq for CMTimeRange
impl StructuralPartialEq for CMTimeRange
Auto Trait Implementations§
impl Freeze for CMTimeRange
impl RefUnwindSafe for CMTimeRange
impl Send for CMTimeRange
impl Sync for CMTimeRange
impl Unpin for CMTimeRange
impl UnsafeUnpin for CMTimeRange
impl UnwindSafe for CMTimeRange
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