[−][src]Struct swim_structure::item::Num
Value
variant representing a number.
Methods
impl<'a> Num<'a>
[src]
pub const fn from_u8(value: u8) -> Num<'a>
[src]
Constructs a new Num
from a u8
value.
pub const fn from_i8(value: i8) -> Num<'a>
[src]
Constructs a new Num
from an i8
value.
pub const fn from_u16(value: u16) -> Num<'a>
[src]
Constructs a new Num
from a u16
value.
pub const fn from_i16(value: i16) -> Num<'a>
[src]
Constructs a new Num
from an i16
value.
pub const fn from_u32(value: u32) -> Num<'a>
[src]
Constructs a new Num
from a u32
value.
pub const fn from_i32(value: i32) -> Num<'a>
[src]
Constructs a new Num
from an i32
value.
pub const fn from_u64(value: u64) -> Num<'a>
[src]
Constructs a new Num
from a u64
value.
pub const fn from_i64(value: i64) -> Num<'a>
[src]
Constructs a new Num
from an i64
value.
pub fn from_f16(value: f16) -> Num<'a>
[src]
Constructs a new Num
from an f16
value.
pub fn from_f32(value: f32) -> Num<'a>
[src]
Constructs a new Num
from an f32
value.
pub fn from_f64(value: f64) -> Num<'a>
[src]
Constructs a new Num
from an f64
value.
pub const fn from_usize(value: usize) -> Num<'a>
[src]
Constructs a new Num
from a usize
value.
pub const fn from_isize(value: isize) -> Num<'a>
[src]
Constructs a new Num
from an isize
value.
pub fn as_value(&self) -> &Value<'a>
[src]
Upcasts this Num
reference to a Value
reference.
pub fn as_mut_value(&mut self) -> &mut Value<'a>
[src]
Upcasts this Num
reference to a mutable Value
reference.
pub fn into_value(self) -> Value<'a>
[src]
Upcasts this Num
to a Value
.
pub fn into_item(self) -> Item<'a>
[src]
Upcasts this Num
to an Item
.
pub fn is_u8(&self) -> bool
[src]
Returns true
if this Num
was created from a u8
value.
pub fn is_i8(&self) -> bool
[src]
Returns true
if this Num
was created from an i8
value.
pub fn is_u16(&self) -> bool
[src]
Returns true
if this Num
was created from a u16
value.
pub fn is_i16(&self) -> bool
[src]
Returns true
if this Num
was created from an i16
value.
pub fn is_u32(&self) -> bool
[src]
Returns true
if this Num
was created from a u32
value.
pub fn is_i32(&self) -> bool
[src]
Returns true
if this Num
was created from an i32
value.
pub fn is_u64(&self) -> bool
[src]
Returns true
if this Num
was created from a u64
value.
pub fn is_i64(&self) -> bool
[src]
Returns true
if this Num
was created from an i64
value.
pub fn is_f16(&self) -> bool
[src]
Returns true
if this Num
was created from an f16
value.
pub fn is_f32(&self) -> bool
[src]
Returns true
if this Num
was created from an f32
value.
pub fn is_f64(&self) -> bool
[src]
Returns true
if this Num
was created from an f64
value.
pub fn is_big_int(&self) -> bool
[src]
Returns true
if this Num
was created from a big integer.
pub fn is_big_dec(&self) -> bool
[src]
Returns true
if this Num
was created from a big decimal.
pub fn is_usize(&self) -> bool
[src]
Returns true
if this Num
was created from a usize
value.
pub fn is_isize(&self) -> bool
[src]
Returns true
if this Num
was created from an isize
value.
pub fn is_valid_u8(&self) -> bool
[src]
Returns true
if this Num
can losslessly convert to a u8
value.
pub fn is_valid_i8(&self) -> bool
[src]
Returns true
if this Num
can losslessly convert to an i8
value.
pub fn is_valid_u16(&self) -> bool
[src]
Returns true
if this Num
can losslessly convert to a u16
value.
pub fn is_valid_i16(&self) -> bool
[src]
Returns true
if this Num
can losslessly convert to an i16
value.
pub fn is_valid_u32(&self) -> bool
[src]
Returns true
if this Num
can losslessly convert to a u32
value.
pub fn is_valid_i32(&self) -> bool
[src]
Returns true
if this Num
can losslessly convert to an i32
value.
pub fn is_valid_u64(&self) -> bool
[src]
Returns true
if this Num
can losslessly convert to a u64
value.
pub fn is_valid_i64(&self) -> bool
[src]
Returns true
if this Num
can losslessly convert to an i64
value.
pub fn is_valid_f16(&self) -> bool
[src]
Returns true
if this Num
can losslessly convert to an f16
value.
pub fn is_valid_f32(&self) -> bool
[src]
Returns true
if this Num
can losslessly convert to an f32
value.
pub fn is_valid_f64(&self) -> bool
[src]
Returns true
if this Num
can losslessly convert to an f64
value.
pub fn is_valid_big_int(&self) -> bool
[src]
Returns true
if this Num
can losslessly convert to a big integer.
pub fn is_valid_big_dec(&self) -> bool
[src]
Returns true
if this Num
can losslessly convert to a big decimal.
pub fn is_valid_usize(&self) -> bool
[src]
Returns true
if this Num
can losslessly convert to a usize
value.
pub fn is_valid_isize(&self) -> bool
[src]
Returns true
if this Num
can losslessly convert to an isize
value.
pub fn as_u8(&self) -> u8
[src]
Coerces this Num
to a u8
value.
pub fn as_i8(&self) -> i8
[src]
Coerces this Num
to an i8
value.
pub fn as_u16(&self) -> u16
[src]
Coerces this Num
to a u16
value.
pub fn as_i16(&self) -> i16
[src]
Coerces this Num
to an i16
value.
pub fn as_u32(&self) -> u32
[src]
Coerces this Num
to a u32
value.
pub fn as_i32(&self) -> i32
[src]
Coerces this Num
to an i32
value.
pub fn as_u64(&self) -> u64
[src]
Coerces this Num
to a u64
value.
pub fn as_i64(&self) -> i64
[src]
Coerces this Num
to an i64
value.
pub fn as_f16(&self) -> f16
[src]
Coerces this Num
to an f16
value.
pub fn as_f32(&self) -> f32
[src]
Coerces this Num
to an f32
value.
pub fn as_f64(&self) -> f64
[src]
Coerces this Num
to an f64
value.
pub fn as_usize(&self) -> usize
[src]
Coerces this Num
to a usize
value.
pub fn as_isize(&self) -> isize
[src]
Coerces this Num
to an isize
value.
pub fn to_u8(&self) -> Option<u8>
[src]
Losslessly converts this Num
to a u8
value, if possible.
pub fn to_i8(&self) -> Option<i8>
[src]
Losslessly converts this Num
to an i8
value, if possible.
pub fn to_u16(&self) -> Option<u16>
[src]
Losslessly converts this Num
to a u16
value, if possible.
pub fn to_i16(&self) -> Option<i16>
[src]
Losslessly converts this Num
to an i16
value, if possible.
pub fn to_u32(&self) -> Option<u32>
[src]
Losslessly converts this Num
to a u32
value, if possible.
pub fn to_i32(&self) -> Option<i32>
[src]
Losslessly converts this Num
to an i32
value, if possible.
pub fn to_u64(&self) -> Option<u64>
[src]
Losslessly converts this Num
to a u64
value, if possible.
pub fn to_i64(&self) -> Option<i64>
[src]
Losslessly converts this Num
to an i64
value, if possible.
pub fn to_f16(&self) -> Option<f16>
[src]
Losslessly converts this Num
to an f16
value, if possible.
pub fn to_f32(&self) -> Option<f32>
[src]
Losslessly converts this Num
to an f32
value, if possible.
pub fn to_f64(&self) -> Option<f64>
[src]
Losslessly converts this Num
to an f64
value, if possible.
pub fn to_usize(&self) -> Option<usize>
[src]
Losslessly converts this Num
to a usize
value, if possible.
pub fn to_isize(&self) -> Option<isize>
[src]
Losslessly converts this Num
to an isize
value, if possible.
Trait Implementations
impl<'a> PartialEq<Num<'a>> for Num<'a>
[src]
fn eq(&self, that: &Num<'a>) -> bool
[src]
#[must_use]
default fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests for !=
.
impl<'a> Eq for Num<'a>
[src]
impl<'a> Ord for Num<'a>
[src]
fn cmp(&self, that: &Num<'a>) -> Ordering
[src]
default fn max(self, other: Self) -> Self
1.21.0[src]
Compares and returns the maximum of two values. Read more
default fn min(self, other: Self) -> Self
1.21.0[src]
Compares and returns the minimum of two values. Read more
default fn clamp(self, min: Self, max: Self) -> Self
[src]
clamp
)Restrict a value to a certain interval. Read more
impl<'a> PartialOrd<Num<'a>> for Num<'a>
[src]
fn partial_cmp(&self, that: &Num<'a>) -> Option<Ordering>
[src]
#[must_use]
default fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests less than (for self
and other
) and is used by the <
operator. Read more
#[must_use]
default fn le(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
#[must_use]
default fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
#[must_use]
default fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
impl<'a> From<Num<'a>> for Item<'a>
[src]
impl<'a> From<Num<'a>> for Value<'a>
[src]
impl<'a> From<u8> for Num<'a>
[src]
impl<'a> From<i8> for Num<'a>
[src]
impl<'a> From<u16> for Num<'a>
[src]
impl<'a> From<i16> for Num<'a>
[src]
impl<'a> From<u32> for Num<'a>
[src]
impl<'a> From<i32> for Num<'a>
[src]
impl<'a> From<u64> for Num<'a>
[src]
impl<'a> From<i64> for Num<'a>
[src]
impl<'a> From<f16> for Num<'a>
[src]
impl<'a> From<f32> for Num<'a>
[src]
impl<'a> From<f64> for Num<'a>
[src]
impl<'a> From<usize> for Num<'a>
[src]
impl<'a> From<isize> for Num<'a>
[src]
impl<'a> Debug for Num<'a>
[src]
impl<'a> Drop for Num<'a>
[src]
impl<'a> Hash for Num<'a>
[src]
fn hash<H: Hasher>(&self, hasher: &mut H)
[src]
default fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more
impl<'a> Clone for Num<'a>
[src]
fn clone(&self) -> Num<'a>
[src]
default fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl<'a> AsMut<Value<'a>> for Num<'a>
[src]
impl<'a> AsRef<Value<'a>> for Num<'a>
[src]
impl<'a> Default for Num<'a>
[src]
impl<'a, 'b> Stow<'b, Num<'b>> for Num<'a>
[src]
unsafe fn stow(
src: *mut Num<'a>,
dst: *mut Num<'b>,
_hold: &dyn Hold<'b>
) -> Result<(), HoldError>
[src]
src: *mut Num<'a>,
dst: *mut Num<'b>,
_hold: &dyn Hold<'b>
) -> Result<(), HoldError>
unsafe fn unstow(_src: *mut Num<'a>, _dst: *mut Num<'b>)
[src]
impl<'a> TryClone for Num<'a>
[src]
impl<'a, 'b> CloneIntoHold<'a, Num<'a>> for Num<'b>
[src]
fn try_clone_into_hold(
&self,
_hold: &dyn Hold<'a>
) -> Result<Num<'a>, HoldError>
[src]
&self,
_hold: &dyn Hold<'a>
) -> Result<Num<'a>, HoldError>
default fn clone_into_hold(&self, hold: &dyn Hold<'a>) -> T
[src]
Returns a clone of self
allocated in hold
. Read more
Auto Trait Implementations
Blanket Implementations
impl<T> From for T
[src]
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<'b, S, T> StowFrom for T where
S: Stow<'b, T>,
[src]
S: Stow<'b, T>,
default fn try_stow_from(
src: S,
hold: &dyn Hold<'b>
) -> Result<T, (S, HoldError)>
[src]
src: S,
hold: &dyn Hold<'b>
) -> Result<T, (S, HoldError)>
default fn stow_from(value: T, hold: &dyn Hold<'b>) -> Self
[src]
impl<'b, S, T> StowInto for S where
T: StowFrom<'b, S>,
[src]
T: StowFrom<'b, S>,