pub struct Base { /* private fields */ }
Expand description
Base
represents a numeral system with single-character digits.
When creating a new numeral system from a given string slice,
the value of each character is its index in the slice,
e.g. the first character has value 0
, the second has value 1
, etc.
If the given slice has at least one duplicate character, parsing will
produce an Err
.
§Examples
use based::*;
let base16: based::Base = "0123456789abcdef".parse().unwrap();
assert_eq!("a", base16.encode(10).unwrap());
Trait Implementations§
Source§impl NumeralSystem<i128> for Base
impl NumeralSystem<i128> for Base
Source§impl NumeralSystem<i16> for Base
impl NumeralSystem<i16> for Base
Source§impl NumeralSystem<i32> for Base
impl NumeralSystem<i32> for Base
Source§impl NumeralSystem<i64> for Base
impl NumeralSystem<i64> for Base
Source§impl NumeralSystem<i8> for Base
impl NumeralSystem<i8> for Base
Source§impl NumeralSystem<isize> for Base
impl NumeralSystem<isize> for Base
Source§impl NumeralSystem<u128> for Base
impl NumeralSystem<u128> for Base
Source§impl NumeralSystem<u16> for Base
impl NumeralSystem<u16> for Base
Source§impl NumeralSystem<u32> for Base
impl NumeralSystem<u32> for Base
Source§impl NumeralSystem<u64> for Base
impl NumeralSystem<u64> for Base
Source§impl NumeralSystem<u8> for Base
impl NumeralSystem<u8> for Base
Auto Trait Implementations§
impl Freeze for Base
impl RefUnwindSafe for Base
impl Send for Base
impl Sync for Base
impl Unpin for Base
impl UnwindSafe for Base
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