pub enum NumberValue {
U8(u8),
U16(u16),
U32(u32),
U64(u64),
U128(u128),
USize(usize),
I8(i8),
I16(i16),
I32(i32),
I64(i64),
I128(i128),
ISize(isize),
}Variants§
U8(u8)
U16(u16)
U32(u32)
U64(u64)
U128(u128)
USize(usize)
I8(i8)
I16(i16)
I32(i32)
I64(i64)
I128(i128)
ISize(isize)
Implementations§
Source§impl NumberValue
impl NumberValue
pub fn kind(&self) -> NumberKind
pub fn new(kind: NumberKind, n: i128) -> Self
pub fn into_usize(self) -> usize
pub fn into_i128(self) -> i128
pub fn iter_to(self, end: Self) -> impl Iterator<Item = Self>
pub fn is_zero(&self) -> bool
pub fn is_positive(&self) -> bool
pub fn abs(&self) -> Self
pub fn into_separated_string(&self) -> String
pub fn into_number_arg(&self) -> NumberArg
pub fn add(self, rhs: Self) -> Result<Self>
pub fn add_usize(self, rhs: usize) -> Self
pub fn sub(self, rhs: Self) -> Result<Self>
pub fn sub_usize(self, rhs: usize) -> Self
Trait Implementations§
Source§impl Clone for NumberValue
impl Clone for NumberValue
Source§fn clone(&self) -> NumberValue
fn clone(&self) -> NumberValue
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for NumberValue
impl Debug for NumberValue
Source§impl Display for NumberValue
impl Display for NumberValue
Source§impl From<&NumberValue> for NumberKind
impl From<&NumberValue> for NumberKind
Source§fn from(value: &NumberValue) -> Self
fn from(value: &NumberValue) -> Self
Converts to this type from the input type.
Source§impl From<NumberValue> for NumberKind
impl From<NumberValue> for NumberKind
Source§fn from(value: NumberValue) -> Self
fn from(value: NumberValue) -> Self
Converts to this type from the input type.
Source§impl From<i128> for NumberValue
impl From<i128> for NumberValue
Source§impl From<i16> for NumberValue
impl From<i16> for NumberValue
Source§impl From<i32> for NumberValue
impl From<i32> for NumberValue
Source§impl From<i64> for NumberValue
impl From<i64> for NumberValue
Source§impl From<i8> for NumberValue
impl From<i8> for NumberValue
Source§impl From<isize> for NumberValue
impl From<isize> for NumberValue
Source§impl From<u128> for NumberValue
impl From<u128> for NumberValue
Source§impl From<u16> for NumberValue
impl From<u16> for NumberValue
Source§impl From<u32> for NumberValue
impl From<u32> for NumberValue
Source§impl From<u64> for NumberValue
impl From<u64> for NumberValue
Source§impl From<u8> for NumberValue
impl From<u8> for NumberValue
Source§impl From<usize> for NumberValue
impl From<usize> for NumberValue
Source§impl Hash for NumberValue
impl Hash for NumberValue
Source§impl Ord for NumberValue
impl Ord for NumberValue
Source§fn cmp(&self, other: &NumberValue) -> Ordering
fn cmp(&self, other: &NumberValue) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for NumberValue
impl PartialEq for NumberValue
Source§impl PartialOrd for NumberValue
impl PartialOrd for NumberValue
Source§impl RangeBounds<NumberValue> for NumberValue
impl RangeBounds<NumberValue> for NumberValue
Source§impl ToTokens for NumberValue
impl ToTokens for NumberValue
Source§fn to_tokens(&self, tokens: &mut TokenStream)
fn to_tokens(&self, tokens: &mut TokenStream)
Source§fn to_token_stream(&self) -> TokenStream
fn to_token_stream(&self) -> TokenStream
Source§fn into_token_stream(self) -> TokenStreamwhere
Self: Sized,
fn into_token_stream(self) -> TokenStreamwhere
Self: Sized,
impl Copy for NumberValue
impl Eq for NumberValue
impl StructuralPartialEq for NumberValue
Auto Trait Implementations§
impl Freeze for NumberValue
impl RefUnwindSafe for NumberValue
impl Send for NumberValue
impl Sync for NumberValue
impl Unpin for NumberValue
impl UnwindSafe for NumberValue
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Spanned for Twhere
T: Spanned + ?Sized,
impl<T> Spanned for Twhere
T: Spanned + ?Sized,
Source§fn span(&self) -> Span
fn span(&self) -> Span
Returns a
Span covering the complete contents of this syntax tree
node, or Span::call_site() if this node is empty.Source§impl<T> Variant for T
impl<T> Variant for T
Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert this
Variant trait object to &mut dyn Any.Source§fn as_boxed_any(self: Box<T>) -> Box<dyn Any>
fn as_boxed_any(self: Box<T>) -> Box<dyn Any>
Convert this
Variant trait object to Box<dyn Any>.