Struct radix_fmt::Radix
[−]
[src]
pub struct Radix<T> { /* fields omitted */ }
A struct to format a number in an arbitrary radix.
Example:
use radix_fmt::Radix; use std::fmt::Write; let n = 15; let mut s = String::new(); write!(&mut s, "{}", Radix::new(n, 3)); assert_eq!(s, "120"); // 15 is "120" in base 3
Methods
impl<T> Radix<T>
[src]
pub fn new(n: T, base: u32) -> Self
[src]
Create a new displayable number from number and base. The base must be in the range [2, 36].
Trait Implementations
impl<T: Debug> Debug for Radix<T>
[src]
fn fmt(&self, __arg_0: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more
impl<T: Clone> Clone for Radix<T>
[src]
fn clone(&self) -> Radix<T>
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl<T: Copy> Copy for Radix<T>
[src]
impl Display for Radix<i8>
[src]
fn fmt(&self, f: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more
impl Display for Radix<u8>
[src]
fn fmt(&self, f: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more
impl Display for Radix<i16>
[src]
fn fmt(&self, f: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more
impl Display for Radix<u16>
[src]
fn fmt(&self, f: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more
impl Display for Radix<i32>
[src]
fn fmt(&self, f: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more
impl Display for Radix<u32>
[src]
fn fmt(&self, f: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more
impl Display for Radix<i64>
[src]
fn fmt(&self, f: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more
impl Display for Radix<u64>
[src]
fn fmt(&self, f: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more
impl Display for Radix<isize>
[src]
fn fmt(&self, f: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more