Struct s_expr::ANum

source · []
pub struct ANum<'a> {
    pub base: ANumBase,
    pub dat: &'a str,
}
Expand description

Integral Number

Fields

base: ANumBasedat: &'a str

Implementations

Get the base of the data

Get the radix of the data, which is either 2 (binary), 10 (decimal) or 16 (hexadecimal)

Get the data associated with the number, which depending on the radix is either binary, decimal and hexadecimal. it also might contains _ separators

Get the digits associated with the number, which depending on the radix is either binary, decimal and hexadecimal. The ‘_’ characters are filtered away

Try to parse the ANum into a u8, which will raise an error if there’s an overflow

Try to parse the ANum into a u16, which will raise an error if there’s an overflow

Try to parse the ANum into a u32, which will raise an error if there’s an overflow

Try to parse the ANum into a u64, which will raise an error if there’s an overflow

Try to parse the ANum into a u128, which will raise an error if there’s an overflow

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.