pub struct CFNumber(/* private fields */);
Expand description

An immutable numeric value.

Implementations§

source§

impl CFNumber

source

pub fn to_i32(&self) -> Option<i32>

source

pub fn to_i64(&self) -> Option<i64>

source

pub fn to_f32(&self) -> Option<f32>

source

pub fn to_f64(&self) -> Option<f64>

Trait Implementations§

source§

impl CFPropertyListSubClass for CFNumber

source§

fn to_CFPropertyList(&self) -> CFPropertyList

Create an instance of the superclass type CFPropertyList for this instance.
source§

fn into_CFPropertyList(self) -> CFPropertyListwhere Self: Sized,

Equal to to_CFPropertyList, but consumes self and avoids changing the reference count.
source§

impl Clone for CFNumber

source§

fn clone(&self) -> CFNumber

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for CFNumber

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Drop for CFNumber

source§

fn drop(&mut self)

Executes the destructor for this type. Read more
source§

impl From<f32> for CFNumber

source§

fn from(value: f32) -> Self

Converts to this type from the input type.
source§

impl From<f64> for CFNumber

source§

fn from(value: f64) -> Self

Converts to this type from the input type.
source§

impl From<i32> for CFNumber

source§

fn from(value: i32) -> Self

Converts to this type from the input type.
source§

impl From<i64> for CFNumber

source§

fn from(value: i64) -> Self

Converts to this type from the input type.
source§

impl Ord for CFNumber

source§

fn cmp(&self, other: &CFNumber) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Selfwhere Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Selfwhere Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Selfwhere Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
source§

impl PartialEq for CFNumber

source§

fn eq(&self, other: &CFNumber) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd for CFNumber

source§

fn partial_cmp(&self, other: &CFNumber) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl TCFType for CFNumber

§

type Ref = *const __CFNumber

The reference type wrapped inside this type.
source§

fn as_concrete_TypeRef(&self) -> CFNumberRef

Returns the object as its concrete TypeRef.
source§

unsafe fn wrap_under_get_rule(reference: CFNumberRef) -> Self

Returns an instance of the object, wrapping the underlying CFTypeRef subclass. Use this when following Core Foundation’s “Get Rule”. The reference count is bumped.
source§

fn as_CFTypeRef(&self) -> CFTypeRef

Returns the object as a raw CFTypeRef. The reference count is not adjusted.
source§

unsafe fn wrap_under_create_rule(reference: CFNumberRef) -> Self

Returns an instance of the object, wrapping the underlying CFTypeRef subclass. Use this when following Core Foundation’s “Create Rule”. The reference count is not bumped.
source§

fn type_id() -> CFTypeID

Returns the type ID for this class.
source§

fn as_CFType(&self) -> CFType

Returns the object as a wrapped CFType. The reference count is incremented by one.
source§

fn into_CFType(self) -> CFTypewhere Self: Sized,

Returns the object as a wrapped CFType. Consumes self and avoids changing the reference count.
source§

fn retain_count(&self) -> CFIndex

Returns the reference count of the object. It is unwise to do anything other than test whether the return value of this method is greater than zero.
source§

fn type_of(&self) -> CFTypeID

Returns the type ID of this object.
source§

fn show(&self)

Writes a debugging version of this object on standard error.
source§

fn instance_of<OtherCFType: TCFType>(&self) -> bool

Returns true if this value is an instance of another type.
source§

impl<'a> ToVoid<CFNumber> for &'a CFNumber

source§

impl ToVoid<CFNumber> for CFNumberRef

source§

impl ToVoid<CFNumber> for CFNumber

source§

impl ConcreteCFType for CFNumber

source§

impl Eq for CFNumber

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> FromMutVoid for Twhere T: TCFType,

source§

unsafe fn from_mut_void<'a>(x: *mut c_void) -> ItemMutRef<'a, T>

source§

impl<T> FromVoid for Twhere T: TCFType,

source§

unsafe fn from_void<'a>(x: *const c_void) -> ItemRef<'a, T>

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.