Struct apint::Radix [−][src]
pub struct Radix(_);
A radix for parsing strings as ApInt
s.
A radix represents the range of valid input characters that represent values
of the to-be-parsed ApInt
.
Supported radices range from binary radix (2
) up
to full case-insensitive alphabet and numerals (36
).
Examples
- The binary 2-radix supports only
0
and1
as input. - The decimal 10-radix supports
0
,1
,...9
as input characters. - The hex-dec 16-radix supports inputs characters within
0
,..,9
anda
,..,f
.
Methods
impl Radix
[src]
impl Radix
pub fn new(radix: u8) -> Result<Radix>
[src]
pub fn new(radix: u8) -> Result<Radix>
Create a new Radix
from the given u8
.
Errors
- If the given value is not within the valid radix range of
2..36
.
pub fn to_u8(self) -> u8
[src]
pub fn to_u8(self) -> u8
Returns the u8
representation of this Radix
.
Trait Implementations
impl Debug for Radix
[src]
impl Debug for Radix
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl Copy for Radix
[src]
impl Copy for Radix
impl Clone for Radix
[src]
impl Clone for Radix
fn clone(&self) -> Radix
[src]
fn clone(&self) -> Radix
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
1.0.0
[src]Performs copy-assignment from source
. Read more
impl PartialEq for Radix
[src]
impl PartialEq for Radix
fn eq(&self, other: &Radix) -> bool
[src]
fn eq(&self, other: &Radix) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Radix) -> bool
[src]
fn ne(&self, other: &Radix) -> bool
This method tests for !=
.
impl Eq for Radix
[src]
impl Eq for Radix
impl Hash for Radix
[src]
impl Hash for Radix
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
Feeds this value into the given [Hasher
]. Read more
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0
[src]Feeds a slice of this type into the given [Hasher
]. Read more
impl From<u8> for Radix
[src]
impl From<u8> for Radix