pub trait FromStringBase: Sized {
// Required method
fn from_string_base(base: u8, s: &str) -> Option<Self>;
}Expand description
Converts a string slice in a given base to a value.
Required Methods§
fn from_string_base(base: u8, s: &str) -> Option<Self>
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementations on Foreign Types§
Source§impl FromStringBase for i8
impl FromStringBase for i8
Source§fn from_string_base(base: u8, s: &str) -> Option<Self>
fn from_string_base(base: u8, s: &str) -> Option<Self>
For bases up to 36, this is a wrapper over the from_str_radix functions in the
standard library, for example this one. For bases from 37
through 62, which from_str_radix does not support, the digits are read from the
case-sensitive large-base alphabet (see digit_from_display_byte_large), as in
GMP.
§Worst-case complexity
$T(n) = O(n)$
$M(n) = O(1)$
where $T$ is time, $M$ is additional memory, and $n$ is s.len().
§Panics
Panics if base is less than 2 or greater than 62.
Source§impl FromStringBase for i16
impl FromStringBase for i16
Source§fn from_string_base(base: u8, s: &str) -> Option<Self>
fn from_string_base(base: u8, s: &str) -> Option<Self>
For bases up to 36, this is a wrapper over the from_str_radix functions in the
standard library, for example this one. For bases from 37
through 62, which from_str_radix does not support, the digits are read from the
case-sensitive large-base alphabet (see digit_from_display_byte_large), as in
GMP.
§Worst-case complexity
$T(n) = O(n)$
$M(n) = O(1)$
where $T$ is time, $M$ is additional memory, and $n$ is s.len().
§Panics
Panics if base is less than 2 or greater than 62.
Source§impl FromStringBase for i32
impl FromStringBase for i32
Source§fn from_string_base(base: u8, s: &str) -> Option<Self>
fn from_string_base(base: u8, s: &str) -> Option<Self>
For bases up to 36, this is a wrapper over the from_str_radix functions in the
standard library, for example this one. For bases from 37
through 62, which from_str_radix does not support, the digits are read from the
case-sensitive large-base alphabet (see digit_from_display_byte_large), as in
GMP.
§Worst-case complexity
$T(n) = O(n)$
$M(n) = O(1)$
where $T$ is time, $M$ is additional memory, and $n$ is s.len().
§Panics
Panics if base is less than 2 or greater than 62.
Source§impl FromStringBase for i64
impl FromStringBase for i64
Source§fn from_string_base(base: u8, s: &str) -> Option<Self>
fn from_string_base(base: u8, s: &str) -> Option<Self>
For bases up to 36, this is a wrapper over the from_str_radix functions in the
standard library, for example this one. For bases from 37
through 62, which from_str_radix does not support, the digits are read from the
case-sensitive large-base alphabet (see digit_from_display_byte_large), as in
GMP.
§Worst-case complexity
$T(n) = O(n)$
$M(n) = O(1)$
where $T$ is time, $M$ is additional memory, and $n$ is s.len().
§Panics
Panics if base is less than 2 or greater than 62.
Source§impl FromStringBase for i128
impl FromStringBase for i128
Source§fn from_string_base(base: u8, s: &str) -> Option<Self>
fn from_string_base(base: u8, s: &str) -> Option<Self>
For bases up to 36, this is a wrapper over the from_str_radix functions in the
standard library, for example this one. For bases from 37
through 62, which from_str_radix does not support, the digits are read from the
case-sensitive large-base alphabet (see digit_from_display_byte_large), as in
GMP.
§Worst-case complexity
$T(n) = O(n)$
$M(n) = O(1)$
where $T$ is time, $M$ is additional memory, and $n$ is s.len().
§Panics
Panics if base is less than 2 or greater than 62.
Source§impl FromStringBase for isize
impl FromStringBase for isize
Source§fn from_string_base(base: u8, s: &str) -> Option<Self>
fn from_string_base(base: u8, s: &str) -> Option<Self>
For bases up to 36, this is a wrapper over the from_str_radix functions in the
standard library, for example this one. For bases from 37
through 62, which from_str_radix does not support, the digits are read from the
case-sensitive large-base alphabet (see digit_from_display_byte_large), as in
GMP.
§Worst-case complexity
$T(n) = O(n)$
$M(n) = O(1)$
where $T$ is time, $M$ is additional memory, and $n$ is s.len().
§Panics
Panics if base is less than 2 or greater than 62.
Source§impl FromStringBase for u8
impl FromStringBase for u8
Source§fn from_string_base(base: u8, s: &str) -> Option<Self>
fn from_string_base(base: u8, s: &str) -> Option<Self>
For bases up to 36, this is a wrapper over the from_str_radix functions in the
standard library, for example this one. For bases from 37
through 62, which from_str_radix does not support, the digits are read from the
case-sensitive large-base alphabet (see digit_from_display_byte_large), as in
GMP.
§Worst-case complexity
$T(n) = O(n)$
$M(n) = O(1)$
where $T$ is time, $M$ is additional memory, and $n$ is s.len().
§Panics
Panics if base is less than 2 or greater than 62.
Source§impl FromStringBase for u16
impl FromStringBase for u16
Source§fn from_string_base(base: u8, s: &str) -> Option<Self>
fn from_string_base(base: u8, s: &str) -> Option<Self>
For bases up to 36, this is a wrapper over the from_str_radix functions in the
standard library, for example this one. For bases from 37
through 62, which from_str_radix does not support, the digits are read from the
case-sensitive large-base alphabet (see digit_from_display_byte_large), as in
GMP.
§Worst-case complexity
$T(n) = O(n)$
$M(n) = O(1)$
where $T$ is time, $M$ is additional memory, and $n$ is s.len().
§Panics
Panics if base is less than 2 or greater than 62.
Source§impl FromStringBase for u32
impl FromStringBase for u32
Source§fn from_string_base(base: u8, s: &str) -> Option<Self>
fn from_string_base(base: u8, s: &str) -> Option<Self>
For bases up to 36, this is a wrapper over the from_str_radix functions in the
standard library, for example this one. For bases from 37
through 62, which from_str_radix does not support, the digits are read from the
case-sensitive large-base alphabet (see digit_from_display_byte_large), as in
GMP.
§Worst-case complexity
$T(n) = O(n)$
$M(n) = O(1)$
where $T$ is time, $M$ is additional memory, and $n$ is s.len().
§Panics
Panics if base is less than 2 or greater than 62.
Source§impl FromStringBase for u64
impl FromStringBase for u64
Source§fn from_string_base(base: u8, s: &str) -> Option<Self>
fn from_string_base(base: u8, s: &str) -> Option<Self>
For bases up to 36, this is a wrapper over the from_str_radix functions in the
standard library, for example this one. For bases from 37
through 62, which from_str_radix does not support, the digits are read from the
case-sensitive large-base alphabet (see digit_from_display_byte_large), as in
GMP.
§Worst-case complexity
$T(n) = O(n)$
$M(n) = O(1)$
where $T$ is time, $M$ is additional memory, and $n$ is s.len().
§Panics
Panics if base is less than 2 or greater than 62.
Source§impl FromStringBase for u128
impl FromStringBase for u128
Source§fn from_string_base(base: u8, s: &str) -> Option<Self>
fn from_string_base(base: u8, s: &str) -> Option<Self>
For bases up to 36, this is a wrapper over the from_str_radix functions in the
standard library, for example this one. For bases from 37
through 62, which from_str_radix does not support, the digits are read from the
case-sensitive large-base alphabet (see digit_from_display_byte_large), as in
GMP.
§Worst-case complexity
$T(n) = O(n)$
$M(n) = O(1)$
where $T$ is time, $M$ is additional memory, and $n$ is s.len().
§Panics
Panics if base is less than 2 or greater than 62.
Source§impl FromStringBase for usize
impl FromStringBase for usize
Source§fn from_string_base(base: u8, s: &str) -> Option<Self>
fn from_string_base(base: u8, s: &str) -> Option<Self>
For bases up to 36, this is a wrapper over the from_str_radix functions in the
standard library, for example this one. For bases from 37
through 62, which from_str_radix does not support, the digits are read from the
case-sensitive large-base alphabet (see digit_from_display_byte_large), as in
GMP.
§Worst-case complexity
$T(n) = O(n)$
$M(n) = O(1)$
where $T$ is time, $M$ is additional memory, and $n$ is s.len().
§Panics
Panics if base is less than 2 or greater than 62.