[−][src]Struct radix_fmt::Radix
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]
Radix<T>: Display,
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(&self) -> Radix<T>
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl<T: Debug> Debug for Radix<T>
[src]
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]
Auto Trait Implementations
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> 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, U> TryInto<U> 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> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,