pub struct CFDate(/* private fields */);Expand description
Safe wrapper around a retained Core Foundation CFDate reference.
Implementations§
Source§impl CFDate
impl CFDate
Sourcepub fn from_raw(ptr: *mut c_void) -> Option<Self>
pub fn from_raw(ptr: *mut c_void) -> Option<Self>
Wraps a +1 retained CFDate pointer and returns None for null.
Sourcepub unsafe fn from_raw_retained(ptr: *mut c_void) -> Option<Self>
pub unsafe fn from_raw_retained(ptr: *mut c_void) -> Option<Self>
Retains a +0 borrowed CFDate pointer and wraps the resulting +1 reference.
§Safety
ptr must be NULL or a valid CFDate pointer.
Sourcepub fn into_cf_type(self) -> CFType
pub fn into_cf_type(self) -> CFType
Consumes this wrapper and returns the erased CFType.
Source§impl CFDate
impl CFDate
Sourcepub fn from_absolute_time(absolute_time: f64) -> Self
pub fn from_absolute_time(absolute_time: f64) -> Self
Create a date from Core Foundation absolute time (seconds since 2001-01-01 00:00:00 UTC).
Sourcepub fn from_system_time(time: SystemTime) -> Self
pub fn from_system_time(time: SystemTime) -> Self
Convert from a Rust SystemTime.
Sourcepub fn absolute_time(&self) -> f64
pub fn absolute_time(&self) -> f64
Core Foundation absolute time.
Sourcepub fn to_system_time(&self) -> Option<SystemTime>
pub fn to_system_time(&self) -> Option<SystemTime>
Convert to SystemTime when representable.
Trait Implementations§
impl Eq for CFDate
impl StructuralPartialEq for CFDate
Auto Trait Implementations§
impl Freeze for CFDate
impl RefUnwindSafe for CFDate
impl !Send for CFDate
impl !Sync for CFDate
impl Unpin for CFDate
impl UnsafeUnpin for CFDate
impl UnwindSafe for CFDate
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