Skip to main content

Number

Struct Number 

Source
pub struct Number(/* private fields */);
Expand description

An Objective-C number object.

C++ equivalent: NS::Number

Implementations§

Source§

impl Number

Source

pub fn number_with_char(value: i8) -> Option<Self>

Create a number from a char.

Source

pub fn number_with_unsigned_char(value: u8) -> Option<Self>

Create a number from an unsigned char.

Source

pub fn number_with_short(value: i16) -> Option<Self>

Create a number from a short.

Source

pub fn number_with_unsigned_short(value: u16) -> Option<Self>

Create a number from an unsigned short.

Source

pub fn number_with_int(value: i32) -> Option<Self>

Create a number from an int.

Source

pub fn number_with_unsigned_int(value: u32) -> Option<Self>

Create a number from an unsigned int.

Source

pub fn number_with_long(value: c_long) -> Option<Self>

Create a number from a long.

Source

pub fn number_with_unsigned_long(value: c_ulong) -> Option<Self>

Create a number from an unsigned long.

Source

pub fn number_with_long_long(value: i64) -> Option<Self>

Create a number from a long long.

Source

pub fn number_with_unsigned_long_long(value: u64) -> Option<Self>

Create a number from an unsigned long long.

Source

pub fn number_with_float(value: f32) -> Option<Self>

Create a number from a float.

Source

pub fn number_with_double(value: f64) -> Option<Self>

Create a number from a double.

Source

pub fn number_with_bool(value: bool) -> Option<Self>

Create a number from a bool.

Source

pub fn alloc() -> Option<Self>

Allocate a new number.

Source

pub fn init_with_coder(&self, coder: *const c_void) -> Option<Self>

Initialize with a coder.

Source

pub fn init_with_char(&self, value: i8) -> Option<Self>

Initialize with a char.

Source

pub fn init_with_unsigned_char(&self, value: u8) -> Option<Self>

Initialize with an unsigned char.

Source

pub fn init_with_short(&self, value: i16) -> Option<Self>

Initialize with a short.

Source

pub fn init_with_unsigned_short(&self, value: u16) -> Option<Self>

Initialize with an unsigned short.

Source

pub fn init_with_int(&self, value: i32) -> Option<Self>

Initialize with an int.

Source

pub fn init_with_unsigned_int(&self, value: u32) -> Option<Self>

Initialize with an unsigned int.

Source

pub fn init_with_long(&self, value: c_long) -> Option<Self>

Initialize with a long.

Source

pub fn init_with_unsigned_long(&self, value: c_ulong) -> Option<Self>

Initialize with an unsigned long.

Source

pub fn init_with_long_long(&self, value: i64) -> Option<Self>

Initialize with a long long.

Source

pub fn init_with_unsigned_long_long(&self, value: u64) -> Option<Self>

Initialize with an unsigned long long.

Source

pub fn init_with_float(&self, value: f32) -> Option<Self>

Initialize with a float.

Source

pub fn init_with_double(&self, value: f64) -> Option<Self>

Initialize with a double.

Source

pub fn init_with_bool(&self, value: bool) -> Option<Self>

Initialize with a bool.

Source

pub fn char_value(&self) -> i8

Get the char value.

Source

pub fn unsigned_char_value(&self) -> u8

Get the unsigned char value.

Source

pub fn short_value(&self) -> i16

Get the short value.

Source

pub fn unsigned_short_value(&self) -> u16

Get the unsigned short value.

Source

pub fn int_value(&self) -> i32

Get the int value.

Source

pub fn unsigned_int_value(&self) -> u32

Get the unsigned int value.

Source

pub fn long_value(&self) -> c_long

Get the long value.

Source

pub fn unsigned_long_value(&self) -> c_ulong

Get the unsigned long value.

Source

pub fn long_long_value(&self) -> i64

Get the long long value.

Source

pub fn unsigned_long_long_value(&self) -> u64

Get the unsigned long long value.

Source

pub fn float_value(&self) -> f32

Get the float value.

Source

pub fn double_value(&self) -> f64

Get the double value.

Source

pub fn bool_value(&self) -> bool

Get the bool value.

Source

pub fn integer_value(&self) -> Integer

Get the integer value.

Source

pub fn unsigned_integer_value(&self) -> UInteger

Get the unsigned integer value.

Source

pub fn string_value(&self) -> *mut String

Get the string value.

Source

pub fn compare(&self, other: &Number) -> ComparisonResult

Compare with another number.

Source

pub fn is_equal_to_number(&self, number: &Number) -> bool

Check if equal to another number.

Source

pub fn description_with_locale(&self, locale: *const c_void) -> *mut String

Get description with locale.

Source

pub unsafe fn from_ptr(ptr: *mut c_void) -> Option<Self>

Create a Number from a raw pointer.

§Safety

The pointer must be a valid Objective-C NSNumber object.

Trait Implementations§

Source§

impl Clone for Number

Source§

fn clone(&self) -> Number

Returns a duplicate 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 Copying for Number

Source§

fn copy(&self) -> Option<Self>

Create a copy of this object. Read more
Source§

impl Debug for Number

Source§

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

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

impl Referencing for Number

Source§

fn as_ptr(&self) -> *const c_void

Get the raw pointer to the Objective-C object.
Source§

fn as_mut_ptr(&self) -> *mut c_void

Get the raw mutable pointer to the Objective-C object.
Source§

fn retain(&self) -> Self
where Self: Clone,

Retain the object, incrementing its reference count. Read more
Source§

fn release(&self)

Release the object, decrementing its reference count. Read more
Source§

fn autorelease(&self) -> Self
where Self: Clone,

Autorelease the object. Read more
Source§

fn retain_count(&self) -> UInteger

Get the retain count of the object. Read more
Source§

impl Send for Number

Source§

impl Sync for Number

Auto Trait Implementations§

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where 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 T
where T: Clone,

Source§

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 T
where U: Into<T>,

Source§

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 T
where U: TryFrom<T>,

Source§

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.