[−][src]Struct bibicode::NumeralSystem
Define a numeral system by enumerating all the digits. The first digit is zero. The radix is equal to the number of digits. One digit can have any number of characters but all digits must have the same length.
Methods
impl NumeralSystem
[src]
pub fn autodetect<'a>(
number: &str,
nums: Vec<&'a NumeralSystem>
) -> Option<&'a NumeralSystem>
[src]
number: &str,
nums: Vec<&'a NumeralSystem>
) -> Option<&'a NumeralSystem>
pub fn new(
prefix: &str,
entry: Vec<Vec<&str>>
) -> Result<NumeralSystem, BibiError>
[src]
prefix: &str,
entry: Vec<Vec<&str>>
) -> Result<NumeralSystem, BibiError>
Returns new numeral system from the strings given. If several vecs are given to the function, figits will be made by a combination of all vecs.
- Exemple for decimal system entry must be vec!(vec!("0", "1", "2", "3", "4", "5", "6", "7", "8", "9"))
pub fn new_from_strings(
prefix: String,
entry: Vec<Vec<String>>
) -> Result<NumeralSystem, BibiError>
[src]
prefix: String,
entry: Vec<Vec<String>>
) -> Result<NumeralSystem, BibiError>
Same as ::new but from vec of strings.
pub fn get_prefixes_from_tags() -> HashMap<String, String>
[src]
pub fn new_from_tag(tag: &str) -> Result<NumeralSystem, BibiError>
[src]
pub fn len(&self) -> usize
[src]
Returns the legth of a digit (all digits have the same length)
pub fn radix(&self) -> usize
[src]
Return the radix of this numeral system (= number of digits in numeral system)
pub fn get_prefix(&self) -> String
[src]
pub fn set_prefix(&mut self, prefix: &str)
[src]
Trait Implementations
impl Display for NumeralSystem
[src]
impl Debug for NumeralSystem
[src]
Auto Trait Implementations
impl Send for NumeralSystem
impl Sync for NumeralSystem
Blanket Implementations
impl<T, U> Into 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> From for T
[src]
impl<T, U> TryFrom 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> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,