Enum rune::ast::Number [−][src]
A resolved number literal.
Variants
Float(f64)
A float literal number.
Integer(BigInt)
An integer literal number.
Implementations
impl Number
[src]
pub fn neg(self) -> Self
[src]
Negate the inner number.
pub fn as_u32(&self, spanned: Span, neg: bool) -> Result<u32, ParseError>
[src]
Convert into a 32-bit unsigned number.
pub fn as_i64(&self, spanned: Span, neg: bool) -> Result<i64, ParseError>
[src]
Convert into a 64-bit signed number.
pub fn as_usize(&self, spanned: Span, neg: bool) -> Result<usize, ParseError>
[src]
Convert into usize.
pub fn as_tuple_index(&self) -> Option<usize>
[src]
Try to convert number into a tuple index.
Trait Implementations
impl Clone for Number
[src]
impl Debug for Number
[src]
impl Display for Number
[src]
impl From<f32> for Number
[src]
impl From<f64> for Number
[src]
impl From<i128> for Number
[src]
impl From<i16> for Number
[src]
impl From<i32> for Number
[src]
impl From<i64> for Number
[src]
impl From<isize> for Number
[src]
impl From<u128> for Number
[src]
impl From<u16> for Number
[src]
impl From<u32> for Number
[src]
impl From<u64> for Number
[src]
impl From<usize> for Number
[src]
Auto Trait Implementations
impl RefUnwindSafe for Number
impl Send for Number
impl Sync for Number
impl Unpin for Number
impl UnwindSafe for Number
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,