Struct bibicode::NumeralSystem [−][src]
pub struct NumeralSystem { /* fields omitted */ }
Expand description
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.
Implementations
impl NumeralSystem
[src]
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]
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]
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 radix(&self) -> usize
[src]
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 Debug for NumeralSystem
[src]
impl Debug for NumeralSystem
[src]Auto Trait Implementations
impl RefUnwindSafe for NumeralSystem
impl Send for NumeralSystem
impl Sync for NumeralSystem
impl Unpin for NumeralSystem
impl UnwindSafe for NumeralSystem
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more