pub trait ToStringBase {
    fn to_string_base(&self, base: u8) -> String;
    fn to_string_base_upper(&self, base: u8) -> String;
}
Expand description

Converts a number to a string using a specified base.

Required Methods

Converts a signed number to a lowercase string using a specified base.

Converts a signed number to an uppercase string using a specified base.

Implementations on Foreign Types

Converts an unsigned number to a string using a specified base.

Digits from 0 to 9 become chars from ‘0’ to ‘9’. Digits from 10 to 35 become the lowercase chars ‘a’ to ‘z’.

Worst-case complexity

$T(n) = O(n)$

$M(n) = O(n)$

where $T$ is time, $M$ is additional memory, and $n$ is self.significant_bits().

Panics

Panics if base is less than 2 or greater than 36.

Examples

See here.

Converts an unsigned number to a string using a specified base.

Digits from 0 to 9 become chars from ‘0’ to ‘9’. Digits from 10 to 35 become the uppercase chars ‘A’ to ‘Z’.

Worst-case complexity

$T(n) = O(n)$

$M(n) = O(n)$

where $T$ is time, $M$ is additional memory, and $n$ is self.significant_bits().

Panics

Panics if base is less than 2 or greater than 36.

Examples

See here.

Converts an unsigned number to a string using a specified base.

Digits from 0 to 9 become chars from ‘0’ to ‘9’. Digits from 10 to 35 become the lowercase chars ‘a’ to ‘z’.

Worst-case complexity

$T(n) = O(n)$

$M(n) = O(n)$

where $T$ is time, $M$ is additional memory, and $n$ is self.significant_bits().

Panics

Panics if base is less than 2 or greater than 36.

Examples

See here.

Converts an unsigned number to a string using a specified base.

Digits from 0 to 9 become chars from ‘0’ to ‘9’. Digits from 10 to 35 become the uppercase chars ‘A’ to ‘Z’.

Worst-case complexity

$T(n) = O(n)$

$M(n) = O(n)$

where $T$ is time, $M$ is additional memory, and $n$ is self.significant_bits().

Panics

Panics if base is less than 2 or greater than 36.

Examples

See here.

Converts an unsigned number to a string using a specified base.

Digits from 0 to 9 become chars from ‘0’ to ‘9’. Digits from 10 to 35 become the lowercase chars ‘a’ to ‘z’.

Worst-case complexity

$T(n) = O(n)$

$M(n) = O(n)$

where $T$ is time, $M$ is additional memory, and $n$ is self.significant_bits().

Panics

Panics if base is less than 2 or greater than 36.

Examples

See here.

Converts an unsigned number to a string using a specified base.

Digits from 0 to 9 become chars from ‘0’ to ‘9’. Digits from 10 to 35 become the uppercase chars ‘A’ to ‘Z’.

Worst-case complexity

$T(n) = O(n)$

$M(n) = O(n)$

where $T$ is time, $M$ is additional memory, and $n$ is self.significant_bits().

Panics

Panics if base is less than 2 or greater than 36.

Examples

See here.

Converts an unsigned number to a string using a specified base.

Digits from 0 to 9 become chars from ‘0’ to ‘9’. Digits from 10 to 35 become the lowercase chars ‘a’ to ‘z’.

Worst-case complexity

$T(n) = O(n)$

$M(n) = O(n)$

where $T$ is time, $M$ is additional memory, and $n$ is self.significant_bits().

Panics

Panics if base is less than 2 or greater than 36.

Examples

See here.

Converts an unsigned number to a string using a specified base.

Digits from 0 to 9 become chars from ‘0’ to ‘9’. Digits from 10 to 35 become the uppercase chars ‘A’ to ‘Z’.

Worst-case complexity

$T(n) = O(n)$

$M(n) = O(n)$

where $T$ is time, $M$ is additional memory, and $n$ is self.significant_bits().

Panics

Panics if base is less than 2 or greater than 36.

Examples

See here.

Converts an unsigned number to a string using a specified base.

Digits from 0 to 9 become chars from ‘0’ to ‘9’. Digits from 10 to 35 become the lowercase chars ‘a’ to ‘z’.

Worst-case complexity

$T(n) = O(n)$

$M(n) = O(n)$

where $T$ is time, $M$ is additional memory, and $n$ is self.significant_bits().

Panics

Panics if base is less than 2 or greater than 36.

Examples

See here.

Converts an unsigned number to a string using a specified base.

Digits from 0 to 9 become chars from ‘0’ to ‘9’. Digits from 10 to 35 become the uppercase chars ‘A’ to ‘Z’.

Worst-case complexity

$T(n) = O(n)$

$M(n) = O(n)$

where $T$ is time, $M$ is additional memory, and $n$ is self.significant_bits().

Panics

Panics if base is less than 2 or greater than 36.

Examples

See here.

Converts an unsigned number to a string using a specified base.

Digits from 0 to 9 become chars from ‘0’ to ‘9’. Digits from 10 to 35 become the lowercase chars ‘a’ to ‘z’.

Worst-case complexity

$T(n) = O(n)$

$M(n) = O(n)$

where $T$ is time, $M$ is additional memory, and $n$ is self.significant_bits().

Panics

Panics if base is less than 2 or greater than 36.

Examples

See here.

Converts an unsigned number to a string using a specified base.

Digits from 0 to 9 become chars from ‘0’ to ‘9’. Digits from 10 to 35 become the uppercase chars ‘A’ to ‘Z’.

Worst-case complexity

$T(n) = O(n)$

$M(n) = O(n)$

where $T$ is time, $M$ is additional memory, and $n$ is self.significant_bits().

Panics

Panics if base is less than 2 or greater than 36.

Examples

See here.

Converts a signed number to a string using a specified base.

Digits from 0 to 9 become chars from ‘0’ to ‘9’. Digits from 10 to 35 become the lowercase chars ‘a’ to ‘z’.

Worst-case complexity

$T(n) = O(n)$

$M(n) = O(n)$

where $T$ is time, $M$ is additional memory, and $n$ is self.significant_bits().

Panics

Panics if base is less than 2 or greater than 36.

Examples

See here.

Converts a signed number to a string using a specified base.

Digits from 0 to 9 become chars from ‘0’ to ‘9’. Digits from 10 to 35 become the uppercase chars ‘A’ to ‘Z’.

Worst-case complexity

$T(n) = O(n)$

$M(n) = O(n)$

where $T$ is time, $M$ is additional memory, and $n$ is self.significant_bits().

Panics

Panics if base is less than 2 or greater than 36.

Examples

See here.

Converts a signed number to a string using a specified base.

Digits from 0 to 9 become chars from ‘0’ to ‘9’. Digits from 10 to 35 become the lowercase chars ‘a’ to ‘z’.

Worst-case complexity

$T(n) = O(n)$

$M(n) = O(n)$

where $T$ is time, $M$ is additional memory, and $n$ is self.significant_bits().

Panics

Panics if base is less than 2 or greater than 36.

Examples

See here.

Converts a signed number to a string using a specified base.

Digits from 0 to 9 become chars from ‘0’ to ‘9’. Digits from 10 to 35 become the uppercase chars ‘A’ to ‘Z’.

Worst-case complexity

$T(n) = O(n)$

$M(n) = O(n)$

where $T$ is time, $M$ is additional memory, and $n$ is self.significant_bits().

Panics

Panics if base is less than 2 or greater than 36.

Examples

See here.

Converts a signed number to a string using a specified base.

Digits from 0 to 9 become chars from ‘0’ to ‘9’. Digits from 10 to 35 become the lowercase chars ‘a’ to ‘z’.

Worst-case complexity

$T(n) = O(n)$

$M(n) = O(n)$

where $T$ is time, $M$ is additional memory, and $n$ is self.significant_bits().

Panics

Panics if base is less than 2 or greater than 36.

Examples

See here.

Converts a signed number to a string using a specified base.

Digits from 0 to 9 become chars from ‘0’ to ‘9’. Digits from 10 to 35 become the uppercase chars ‘A’ to ‘Z’.

Worst-case complexity

$T(n) = O(n)$

$M(n) = O(n)$

where $T$ is time, $M$ is additional memory, and $n$ is self.significant_bits().

Panics

Panics if base is less than 2 or greater than 36.

Examples

See here.

Converts a signed number to a string using a specified base.

Digits from 0 to 9 become chars from ‘0’ to ‘9’. Digits from 10 to 35 become the lowercase chars ‘a’ to ‘z’.

Worst-case complexity

$T(n) = O(n)$

$M(n) = O(n)$

where $T$ is time, $M$ is additional memory, and $n$ is self.significant_bits().

Panics

Panics if base is less than 2 or greater than 36.

Examples

See here.

Converts a signed number to a string using a specified base.

Digits from 0 to 9 become chars from ‘0’ to ‘9’. Digits from 10 to 35 become the uppercase chars ‘A’ to ‘Z’.

Worst-case complexity

$T(n) = O(n)$

$M(n) = O(n)$

where $T$ is time, $M$ is additional memory, and $n$ is self.significant_bits().

Panics

Panics if base is less than 2 or greater than 36.

Examples

See here.

Converts a signed number to a string using a specified base.

Digits from 0 to 9 become chars from ‘0’ to ‘9’. Digits from 10 to 35 become the lowercase chars ‘a’ to ‘z’.

Worst-case complexity

$T(n) = O(n)$

$M(n) = O(n)$

where $T$ is time, $M$ is additional memory, and $n$ is self.significant_bits().

Panics

Panics if base is less than 2 or greater than 36.

Examples

See here.

Converts a signed number to a string using a specified base.

Digits from 0 to 9 become chars from ‘0’ to ‘9’. Digits from 10 to 35 become the uppercase chars ‘A’ to ‘Z’.

Worst-case complexity

$T(n) = O(n)$

$M(n) = O(n)$

where $T$ is time, $M$ is additional memory, and $n$ is self.significant_bits().

Panics

Panics if base is less than 2 or greater than 36.

Examples

See here.

Converts a signed number to a string using a specified base.

Digits from 0 to 9 become chars from ‘0’ to ‘9’. Digits from 10 to 35 become the lowercase chars ‘a’ to ‘z’.

Worst-case complexity

$T(n) = O(n)$

$M(n) = O(n)$

where $T$ is time, $M$ is additional memory, and $n$ is self.significant_bits().

Panics

Panics if base is less than 2 or greater than 36.

Examples

See here.

Converts a signed number to a string using a specified base.

Digits from 0 to 9 become chars from ‘0’ to ‘9’. Digits from 10 to 35 become the uppercase chars ‘A’ to ‘Z’.

Worst-case complexity

$T(n) = O(n)$

$M(n) = O(n)$

where $T$ is time, $M$ is additional memory, and $n$ is self.significant_bits().

Panics

Panics if base is less than 2 or greater than 36.

Examples

See here.

Implementors