[][src]Struct bibicode::NumeralSystem

pub struct NumeralSystem { /* fields omitted */ }

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]

pub fn new(
    prefix: &str,
    entry: Vec<Vec<&str>>
) -> Result<NumeralSystem, BibiError>
[src]

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]

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

Blanket Implementations

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T> From for T[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Any for T where
    T: 'static + ?Sized
[src]