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