pub struct Number(/* private fields */);Expand description
An Objective-C number object.
C++ equivalent: NS::Number
Implementations§
Source§impl Number
impl Number
Sourcepub fn number_with_char(value: i8) -> Option<Self>
pub fn number_with_char(value: i8) -> Option<Self>
Create a number from a char.
Sourcepub fn number_with_unsigned_char(value: u8) -> Option<Self>
pub fn number_with_unsigned_char(value: u8) -> Option<Self>
Create a number from an unsigned char.
Sourcepub fn number_with_short(value: i16) -> Option<Self>
pub fn number_with_short(value: i16) -> Option<Self>
Create a number from a short.
Sourcepub fn number_with_unsigned_short(value: u16) -> Option<Self>
pub fn number_with_unsigned_short(value: u16) -> Option<Self>
Create a number from an unsigned short.
Sourcepub fn number_with_int(value: i32) -> Option<Self>
pub fn number_with_int(value: i32) -> Option<Self>
Create a number from an int.
Sourcepub fn number_with_unsigned_int(value: u32) -> Option<Self>
pub fn number_with_unsigned_int(value: u32) -> Option<Self>
Create a number from an unsigned int.
Sourcepub fn number_with_long(value: c_long) -> Option<Self>
pub fn number_with_long(value: c_long) -> Option<Self>
Create a number from a long.
Sourcepub fn number_with_unsigned_long(value: c_ulong) -> Option<Self>
pub fn number_with_unsigned_long(value: c_ulong) -> Option<Self>
Create a number from an unsigned long.
Sourcepub fn number_with_long_long(value: i64) -> Option<Self>
pub fn number_with_long_long(value: i64) -> Option<Self>
Create a number from a long long.
Sourcepub fn number_with_unsigned_long_long(value: u64) -> Option<Self>
pub fn number_with_unsigned_long_long(value: u64) -> Option<Self>
Create a number from an unsigned long long.
Sourcepub fn number_with_float(value: f32) -> Option<Self>
pub fn number_with_float(value: f32) -> Option<Self>
Create a number from a float.
Sourcepub fn number_with_double(value: f64) -> Option<Self>
pub fn number_with_double(value: f64) -> Option<Self>
Create a number from a double.
Sourcepub fn number_with_bool(value: bool) -> Option<Self>
pub fn number_with_bool(value: bool) -> Option<Self>
Create a number from a bool.
Sourcepub fn init_with_coder(&self, coder: *const c_void) -> Option<Self>
pub fn init_with_coder(&self, coder: *const c_void) -> Option<Self>
Initialize with a coder.
Sourcepub fn init_with_char(&self, value: i8) -> Option<Self>
pub fn init_with_char(&self, value: i8) -> Option<Self>
Initialize with a char.
Sourcepub fn init_with_unsigned_char(&self, value: u8) -> Option<Self>
pub fn init_with_unsigned_char(&self, value: u8) -> Option<Self>
Initialize with an unsigned char.
Sourcepub fn init_with_short(&self, value: i16) -> Option<Self>
pub fn init_with_short(&self, value: i16) -> Option<Self>
Initialize with a short.
Sourcepub fn init_with_unsigned_short(&self, value: u16) -> Option<Self>
pub fn init_with_unsigned_short(&self, value: u16) -> Option<Self>
Initialize with an unsigned short.
Sourcepub fn init_with_int(&self, value: i32) -> Option<Self>
pub fn init_with_int(&self, value: i32) -> Option<Self>
Initialize with an int.
Sourcepub fn init_with_unsigned_int(&self, value: u32) -> Option<Self>
pub fn init_with_unsigned_int(&self, value: u32) -> Option<Self>
Initialize with an unsigned int.
Sourcepub fn init_with_long(&self, value: c_long) -> Option<Self>
pub fn init_with_long(&self, value: c_long) -> Option<Self>
Initialize with a long.
Sourcepub fn init_with_unsigned_long(&self, value: c_ulong) -> Option<Self>
pub fn init_with_unsigned_long(&self, value: c_ulong) -> Option<Self>
Initialize with an unsigned long.
Sourcepub fn init_with_long_long(&self, value: i64) -> Option<Self>
pub fn init_with_long_long(&self, value: i64) -> Option<Self>
Initialize with a long long.
Sourcepub fn init_with_unsigned_long_long(&self, value: u64) -> Option<Self>
pub fn init_with_unsigned_long_long(&self, value: u64) -> Option<Self>
Initialize with an unsigned long long.
Sourcepub fn init_with_float(&self, value: f32) -> Option<Self>
pub fn init_with_float(&self, value: f32) -> Option<Self>
Initialize with a float.
Sourcepub fn init_with_double(&self, value: f64) -> Option<Self>
pub fn init_with_double(&self, value: f64) -> Option<Self>
Initialize with a double.
Sourcepub fn init_with_bool(&self, value: bool) -> Option<Self>
pub fn init_with_bool(&self, value: bool) -> Option<Self>
Initialize with a bool.
Sourcepub fn char_value(&self) -> i8
pub fn char_value(&self) -> i8
Get the char value.
Sourcepub fn unsigned_char_value(&self) -> u8
pub fn unsigned_char_value(&self) -> u8
Get the unsigned char value.
Sourcepub fn short_value(&self) -> i16
pub fn short_value(&self) -> i16
Get the short value.
Sourcepub fn unsigned_short_value(&self) -> u16
pub fn unsigned_short_value(&self) -> u16
Get the unsigned short value.
Sourcepub fn unsigned_int_value(&self) -> u32
pub fn unsigned_int_value(&self) -> u32
Get the unsigned int value.
Sourcepub fn long_value(&self) -> c_long
pub fn long_value(&self) -> c_long
Get the long value.
Sourcepub fn unsigned_long_value(&self) -> c_ulong
pub fn unsigned_long_value(&self) -> c_ulong
Get the unsigned long value.
Sourcepub fn long_long_value(&self) -> i64
pub fn long_long_value(&self) -> i64
Get the long long value.
Sourcepub fn unsigned_long_long_value(&self) -> u64
pub fn unsigned_long_long_value(&self) -> u64
Get the unsigned long long value.
Sourcepub fn float_value(&self) -> f32
pub fn float_value(&self) -> f32
Get the float value.
Sourcepub fn double_value(&self) -> f64
pub fn double_value(&self) -> f64
Get the double value.
Sourcepub fn bool_value(&self) -> bool
pub fn bool_value(&self) -> bool
Get the bool value.
Sourcepub fn integer_value(&self) -> Integer
pub fn integer_value(&self) -> Integer
Get the integer value.
Sourcepub fn unsigned_integer_value(&self) -> UInteger
pub fn unsigned_integer_value(&self) -> UInteger
Get the unsigned integer value.
Sourcepub fn string_value(&self) -> *mut String
pub fn string_value(&self) -> *mut String
Get the string value.
Sourcepub fn compare(&self, other: &Number) -> ComparisonResult
pub fn compare(&self, other: &Number) -> ComparisonResult
Compare with another number.
Sourcepub fn is_equal_to_number(&self, number: &Number) -> bool
pub fn is_equal_to_number(&self, number: &Number) -> bool
Check if equal to another number.