[−][src]Struct based::Base
Base represents a numeral system with single-character digits.
Methods
impl Base[src]
pub fn new(base: &str) -> Base[src]
Creates a new numeral system from the given string slice.
The value of each character is its index in the slice,
e.g. the first character has value 0, the second value 1, etc.
The behavior of this function is undefined when a character is present more than once in the given string slice.
Examples
use based::Base; let base16 = based::Base::new("0123456789abcdef");
Trait Implementations
impl Display for Base[src]
impl NumeralSystem<i128> for Base[src]
fn from_str(&self, rep: &str) -> Result<i128, StrError>[src]
fn digits(&self, val: i128) -> Result<String, TryFromIntError>[src]
impl NumeralSystem<i16> for Base[src]
fn from_str(&self, rep: &str) -> Result<i16, StrError>[src]
fn digits(&self, val: i16) -> Result<String, TryFromIntError>[src]
impl NumeralSystem<i32> for Base[src]
fn from_str(&self, rep: &str) -> Result<i32, StrError>[src]
fn digits(&self, val: i32) -> Result<String, TryFromIntError>[src]
impl NumeralSystem<i64> for Base[src]
fn from_str(&self, rep: &str) -> Result<i64, StrError>[src]
fn digits(&self, val: i64) -> Result<String, TryFromIntError>[src]
impl NumeralSystem<i8> for Base[src]
fn from_str(&self, rep: &str) -> Result<i8, StrError>[src]
fn digits(&self, val: i8) -> Result<String, TryFromIntError>[src]
impl NumeralSystem<isize> for Base[src]
fn from_str(&self, rep: &str) -> Result<isize, StrError>[src]
fn digits(&self, val: isize) -> Result<String, TryFromIntError>[src]
impl NumeralSystem<u128> for Base[src]
fn from_str(&self, rep: &str) -> Result<u128, StrError>[src]
fn digits(&self, val: u128) -> Result<String, TryFromIntError>[src]
impl NumeralSystem<u16> for Base[src]
fn from_str(&self, rep: &str) -> Result<u16, StrError>[src]
fn digits(&self, val: u16) -> Result<String, TryFromIntError>[src]
Never produces Err.
impl NumeralSystem<u32> for Base[src]
fn from_str(&self, rep: &str) -> Result<u32, StrError>[src]
fn digits(&self, val: u32) -> Result<String, TryFromIntError>[src]
impl NumeralSystem<u64> for Base[src]
fn from_str(&self, rep: &str) -> Result<u64, StrError>[src]
fn digits(&self, val: u64) -> Result<String, TryFromIntError>[src]
impl NumeralSystem<u8> for Base[src]
fn from_str(&self, rep: &str) -> Result<u8, StrError>[src]
fn digits(&self, val: u8) -> Result<String, TryFromIntError>[src]
Never produces Err.
impl NumeralSystem<usize> for Base[src]
Auto Trait Implementations
impl RefUnwindSafe for Base
impl Send for Base
impl Sync for Base
impl Unpin for Base
impl UnwindSafe for Base
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,
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> 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.
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>,