[][src]Struct radix_fmt::Radix

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> where
    Radix<T>: Display
[src]

pub fn new(n: T, base: u8) -> Self[src]

Create a new displayable number from number and base. The base must be in the range [2, 36].

Trait Implementations

impl<T: Copy> Copy for Radix<T>[src]

impl<T: Clone> Clone for Radix<T>[src]

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

impl Display for Radix<i8>[src]

impl Display for Radix<u8>[src]

impl Display for Radix<i16>[src]

impl Display for Radix<u16>[src]

impl Display for Radix<i32>[src]

impl Display for Radix<u32>[src]

impl Display for Radix<i64>[src]

impl Display for Radix<u64>[src]

impl Display for Radix<i128>[src]

impl Display for Radix<u128>[src]

impl Display for Radix<isize>[src]

impl Display for Radix<usize>[src]

impl Display for Radix<NonZeroI8>[src]

impl Display for Radix<NonZeroU8>[src]

impl Display for Radix<NonZeroI16>[src]

impl Display for Radix<NonZeroU16>[src]

impl Display for Radix<NonZeroI32>[src]

impl Display for Radix<NonZeroU32>[src]

impl Display for Radix<NonZeroI64>[src]

impl Display for Radix<NonZeroU64>[src]

impl Display for Radix<NonZeroI128>[src]

impl Display for Radix<NonZeroU128>[src]

impl Display for Radix<NonZeroIsize>[src]

impl Display for Radix<NonZeroUsize>[src]

impl<T: Debug> Debug for Radix<T>[src]

Auto Trait Implementations

impl<T> Send for Radix<T> where
    T: Send

impl<T> Sync for Radix<T> where
    T: Sync

Blanket Implementations

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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

impl<T> From<T> for T[src]

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

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

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> 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> BorrowMut<T> for T where
    T: ?Sized
[src]

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

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