pub struct CFDateFormatter(/* private fields */);Expand description
Safe wrapper around a retained Core Foundation CFDateFormatter reference.
Implementations§
Source§impl CFDateFormatter
impl CFDateFormatter
Sourcepub fn from_raw(ptr: *mut c_void) -> Option<Self>
pub fn from_raw(ptr: *mut c_void) -> Option<Self>
Wraps a +1 retained CFDateFormatter 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 CFDateFormatter pointer and wraps the resulting +1 reference.
§Safety
ptr must be NULL or a valid CFDateFormatter 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 CFDateFormatter
impl CFDateFormatter
Sourcepub fn new(
locale: Option<&CFLocale>,
date_style: CFDateFormatterStyle,
time_style: CFDateFormatterStyle,
) -> Self
pub fn new( locale: Option<&CFLocale>, date_style: CFDateFormatterStyle, time_style: CFDateFormatterStyle, ) -> Self
Create a date formatter for the given locale and styles.
Sourcepub fn format_date(&self, date: &CFDate) -> CFString
pub fn format_date(&self, date: &CFDate) -> CFString
Format a date into a localized string.
Trait Implementations§
Source§impl AsCFType for CFDateFormatter
impl AsCFType for CFDateFormatter
Source§impl Clone for CFDateFormatter
impl Clone for CFDateFormatter
Source§fn clone(&self) -> CFDateFormatter
fn clone(&self) -> CFDateFormatter
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 CFDateFormatter
impl Debug for CFDateFormatter
Source§impl Hash for CFDateFormatter
impl Hash for CFDateFormatter
Source§impl PartialEq for CFDateFormatter
impl PartialEq for CFDateFormatter
Source§fn eq(&self, other: &CFDateFormatter) -> bool
fn eq(&self, other: &CFDateFormatter) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Eq for CFDateFormatter
impl StructuralPartialEq for CFDateFormatter
Auto Trait Implementations§
impl Freeze for CFDateFormatter
impl RefUnwindSafe for CFDateFormatter
impl !Send for CFDateFormatter
impl !Sync for CFDateFormatter
impl Unpin for CFDateFormatter
impl UnsafeUnpin for CFDateFormatter
impl UnwindSafe for CFDateFormatter
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