#[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
pub const INVALID: Self
pub const fn new(start: CMTime, duration: CMTime) -> Self
pub fn end(&self) -> CMTime
pub const fn is_valid(&self) -> bool
pub fn contains_time(&self, time: CMTime) -> bool
pub fn contains_range(&self, other: Self) -> bool
pub fn intersection(&self, other: Self) -> Self
pub fn union(&self, other: Self) -> Self
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