pub enum IntValue {
I8(i8),
I16(i16),
I32(i32),
I64(i64),
U8(u8),
U16(u16),
U32(u32),
U64(u64),
}Variants§
Implementations§
Source§impl IntValue
impl IntValue
pub fn to_i64(&self) -> i64
Sourcepub fn try_to_i64(&self) -> Option<i64>
pub fn try_to_i64(&self) -> Option<i64>
Returns the signed representation when it is exactly representable.
Unlike Self::to_i64, this never saturates an out-of-range uint64.
Sourcepub fn try_to_i32(&self) -> Option<i32>
pub fn try_to_i32(&self) -> Option<i32>
Returns the int32 representation when it is exactly representable.
Sourcepub fn try_to_isize(&self) -> Option<isize>
pub fn try_to_isize(&self) -> Option<isize>
Returns the platform signed representation when it is exactly representable.
This is intended for signed offsets and shifts. In particular, it
rejects uint64 values above int64::MAX instead of saturating them.
Sourcepub fn try_to_u64(&self) -> Option<u64>
pub fn try_to_u64(&self) -> Option<u64>
Returns the unsigned representation when it is exactly representable.
Sourcepub fn try_to_usize(&self) -> Option<usize>
pub fn try_to_usize(&self) -> Option<usize>
Returns the platform dimension representation when it is exactly representable and non-negative.
pub fn to_f64(&self) -> f64
pub fn is_zero(&self) -> bool
pub fn class_name(&self) -> &'static str
Sourcepub fn decimal_string(&self) -> String
pub fn decimal_string(&self) -> String
Returns the exact base-10 representation without narrowing through a signed integer or floating-point compatibility path.
Sourcepub fn saturating_add(&self, rhs: &Self) -> Result<Self, String>
pub fn saturating_add(&self, rhs: &Self) -> Result<Self, String>
Add two values of the same MATLAB integer class with saturating semantics. Sparse triplet construction uses this for duplicate entries.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for IntValue
impl<'de> Deserialize<'de> for IntValue
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for IntValue
Source§impl From<&IntegerLiteral> for IntValue
impl From<&IntegerLiteral> for IntValue
Source§fn from(literal: &IntegerLiteral) -> Self
fn from(literal: &IntegerLiteral) -> Self
Source§impl From<IntValue> for NumericScalar
impl From<IntValue> for NumericScalar
impl StructuralPartialEq for IntValue
Auto Trait Implementations§
impl Freeze for IntValue
impl RefUnwindSafe for IntValue
impl Send for IntValue
impl Sync for IntValue
impl Unpin for IntValue
impl UnsafeUnpin for IntValue
impl UnwindSafe for IntValue
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.