pub struct CFNumberFormatter { /* private fields */ }
Available on crate feature
CFNumberFormatter
only.Expand description
Implementations§
Source§impl CFNumberFormatter
impl CFNumberFormatter
Sourcepub unsafe fn new(
allocator: Option<&CFAllocator>,
locale: Option<&CFLocale>,
style: CFNumberFormatterStyle,
) -> Option<CFRetained<CFNumberFormatter>>
Available on crate feature CFLocale
only.
pub unsafe fn new( allocator: Option<&CFAllocator>, locale: Option<&CFLocale>, style: CFNumberFormatterStyle, ) -> Option<CFRetained<CFNumberFormatter>>
CFLocale
only.§Safety
allocator
might not allowNone
.locale
might not allowNone
.
pub fn locale(&self) -> Option<CFRetained<CFLocale>>
Available on crate feature
CFLocale
only.pub fn style(&self) -> CFNumberFormatterStyle
pub fn format(&self) -> Option<CFRetained<CFString>>
Sourcepub unsafe fn set_format(&self, format_string: Option<&CFString>)
pub unsafe fn set_format(&self, format_string: Option<&CFString>)
§Safety
format_string
might not allow None
.
Sourcepub unsafe fn new_string_with_number(
allocator: Option<&CFAllocator>,
formatter: Option<&CFNumberFormatter>,
number: Option<&CFNumber>,
) -> Option<CFRetained<CFString>>
Available on crate feature CFNumber
only.
pub unsafe fn new_string_with_number( allocator: Option<&CFAllocator>, formatter: Option<&CFNumberFormatter>, number: Option<&CFNumber>, ) -> Option<CFRetained<CFString>>
CFNumber
only.§Safety
allocator
might not allowNone
.formatter
might not allowNone
.number
might not allowNone
.
Sourcepub unsafe fn new_string_with_value(
allocator: Option<&CFAllocator>,
formatter: Option<&CFNumberFormatter>,
number_type: CFNumberType,
value_ptr: *const c_void,
) -> Option<CFRetained<CFString>>
Available on crate feature CFNumber
only.
pub unsafe fn new_string_with_value( allocator: Option<&CFAllocator>, formatter: Option<&CFNumberFormatter>, number_type: CFNumberType, value_ptr: *const c_void, ) -> Option<CFRetained<CFString>>
CFNumber
only.§Safety
allocator
might not allowNone
.formatter
might not allowNone
.value_ptr
must be a valid pointer.
Source§impl CFNumberFormatter
impl CFNumberFormatter
Sourcepub unsafe fn new_number_from_string(
allocator: Option<&CFAllocator>,
formatter: Option<&CFNumberFormatter>,
string: Option<&CFString>,
rangep: *mut CFRange,
options: CFOptionFlags,
) -> Option<CFRetained<CFNumber>>
Available on crate feature CFNumber
only.
pub unsafe fn new_number_from_string( allocator: Option<&CFAllocator>, formatter: Option<&CFNumberFormatter>, string: Option<&CFString>, rangep: *mut CFRange, options: CFOptionFlags, ) -> Option<CFRetained<CFNumber>>
CFNumber
only.§Safety
allocator
might not allowNone
.formatter
might not allowNone
.string
might not allowNone
.rangep
must be a valid pointer.
Sourcepub unsafe fn value_from_string(
&self,
string: Option<&CFString>,
rangep: *mut CFRange,
number_type: CFNumberType,
value_ptr: *mut c_void,
) -> bool
Available on crate feature CFNumber
only.
pub unsafe fn value_from_string( &self, string: Option<&CFString>, rangep: *mut CFRange, number_type: CFNumberType, value_ptr: *mut c_void, ) -> bool
CFNumber
only.§Safety
string
might not allowNone
.rangep
must be a valid pointer.value_ptr
must be a valid pointer.
Sourcepub unsafe fn set_property(
&self,
key: Option<&CFNumberFormatterKey>,
value: Option<&CFType>,
)
pub unsafe fn set_property( &self, key: Option<&CFNumberFormatterKey>, value: Option<&CFType>, )
§Safety
key
might not allowNone
.value
should be of the correct type.value
might not allowNone
.
Sourcepub unsafe fn property(
&self,
key: Option<&CFNumberFormatterKey>,
) -> Option<CFRetained<CFType>>
pub unsafe fn property( &self, key: Option<&CFNumberFormatterKey>, ) -> Option<CFRetained<CFType>>
§Safety
key
might not allow None
.
Source§impl CFNumberFormatter
impl CFNumberFormatter
Sourcepub unsafe fn decimal_info_for_currency_code(
currency_code: Option<&CFString>,
default_fraction_digits: *mut i32,
rounding_increment: *mut c_double,
) -> bool
pub unsafe fn decimal_info_for_currency_code( currency_code: Option<&CFString>, default_fraction_digits: *mut i32, rounding_increment: *mut c_double, ) -> bool
§Safety
currency_code
might not allowNone
.default_fraction_digits
must be a valid pointer.rounding_increment
must be a valid pointer.
Methods from Deref<Target = CFType>§
Sourcepub fn downcast_ref<T: ConcreteType>(&self) -> Option<&T>
pub fn downcast_ref<T: ConcreteType>(&self) -> Option<&T>
Attempt to downcast the type to that of type T
.
This is the reference-variant. Use CFRetained::downcast
if you
want to convert a retained type. See also ConcreteType
for more
details on which types support being converted to.
Sourcepub fn retain_count(&self) -> usize
pub fn retain_count(&self) -> usize
Get the reference count of the object.
This function may be useful for debugging. You normally do not use this function otherwise.
Beware that some things (like CFNumber
s, small CFString
s etc.) may
not have a normal retain count for optimization purposes, and can
return usize::MAX
in that case.
Trait Implementations§
Source§impl AsRef<AnyObject> for CFNumberFormatter
impl AsRef<AnyObject> for CFNumberFormatter
Source§impl AsRef<CFNumberFormatter> for CFNumberFormatter
impl AsRef<CFNumberFormatter> for CFNumberFormatter
Source§impl AsRef<CFType> for CFNumberFormatter
impl AsRef<CFType> for CFNumberFormatter
Source§impl Borrow<AnyObject> for CFNumberFormatter
impl Borrow<AnyObject> for CFNumberFormatter
Source§impl Borrow<CFType> for CFNumberFormatter
impl Borrow<CFType> for CFNumberFormatter
Source§impl ConcreteType for CFNumberFormatter
impl ConcreteType for CFNumberFormatter
Source§impl Debug for CFNumberFormatter
impl Debug for CFNumberFormatter
Source§impl Deref for CFNumberFormatter
impl Deref for CFNumberFormatter
Source§impl Hash for CFNumberFormatter
impl Hash for CFNumberFormatter
Source§impl Message for CFNumberFormatter
impl Message for CFNumberFormatter
Source§impl PartialEq for CFNumberFormatter
impl PartialEq for CFNumberFormatter
Source§impl RefEncode for CFNumberFormatter
impl RefEncode for CFNumberFormatter
Source§const ENCODING_REF: Encoding
const ENCODING_REF: Encoding
The Objective-C type-encoding for a reference of this type. Read more
Source§impl Type for CFNumberFormatter
impl Type for CFNumberFormatter
Source§fn retain(&self) -> CFRetained<Self> ⓘwhere
Self: Sized,
fn retain(&self) -> CFRetained<Self> ⓘwhere
Self: Sized,
Increment the reference count of the receiver. Read more
Source§fn as_concrete_TypeRef(&self) -> &Self
fn as_concrete_TypeRef(&self) -> &Self
👎Deprecated: this is redundant
Helper for easier transition from the
core-foundation
crate.Source§unsafe fn wrap_under_get_rule(ptr: *const Self) -> CFRetained<Self> ⓘwhere
Self: Sized,
unsafe fn wrap_under_get_rule(ptr: *const Self) -> CFRetained<Self> ⓘwhere
Self: Sized,
👎Deprecated: use CFRetained::retain
Helper for easier transition from the
core-foundation
crate. Read moreSource§fn as_CFTypeRef(&self) -> &CFType
fn as_CFTypeRef(&self) -> &CFType
👎Deprecated: this is redundant (CF types deref to CFType)
Helper for easier transition from the
core-foundation
crate.Source§unsafe fn wrap_under_create_rule(ptr: *const Self) -> CFRetained<Self> ⓘwhere
Self: Sized,
unsafe fn wrap_under_create_rule(ptr: *const Self) -> CFRetained<Self> ⓘwhere
Self: Sized,
👎Deprecated: use CFRetained::from_raw
Helper for easier transition from the
core-foundation
crate. Read moreimpl Eq 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 !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