/// Converts a string slice in a given base to an integer.
///
/// The string is expected to be an optional `+` or `-` sign followed by digits.
/// Leading and trailing whitespace represent an error. Digits are a subset of these characters,
/// depending on `radix`:
///
/// * `0-9`
/// * `a-z`
/// * `A-Z`
///
/// # Panics
///
/// This function panics if `radix` is not in the range from 2 to 36.
///
/// # Examples
///
/// Basic usage:
///
/// ```
/// # use js_int::{int, Int};
/// assert_eq!(Int::from_str_radix("A", 16), Ok(int!(10)));
/// ```
Converts a string slice in a given base to an integer.
The string is expected to be an optional `+` or `-` sign followed by digits.
Leading and trailing whitespace represent an error. Digits are a subset of these characters,
depending on `radix`.


Converts a string slice in a given base to an integer . The string is expected to be an optional ` + ` or ` - ` sign followed by digits . Leading and trailing whitespace represent an error . Digits are a subset of these characters depending on ` radix ` .
pub fn from_str_radix(src: &str, radix: u32) -> Result<Self, ParseIntError> {
        let val = i64::from_str_radix(src, radix)?;
        if val < MIN_SAFE_INT {
            Err(ParseIntError { kind: ParseIntErrorKind::Underflow })
        } else if val > MAX_SAFE_INT {
            Err(ParseIntError { kind: ParseIntErrorKind::Overflow })
        } else {
            Ok(Self(val))
        }
    }
pub fn from_str_radix ( src : & str , radix : u32 ) -> Result < Self , ParseIntError > { let val = i64 :: from_str_radix ( src , radix ) ? ; if val < MIN_SAFE_INT { Err ( ParseIntError { kind : ParseIntErrorKind :: Underflow } ) } else if val > MAX_SAFE_INT { Err ( ParseIntError { kind : ParseIntErrorKind :: Overflow } ) } else { Ok ( Self ( val ) ) } }
Converts a string slice in a given base to an integer.
Converts a string slice in a given base to an integer .
src
&str
radix
u32
panics
This function panics if `radix` is not in the range from 2 to 36.
This function panics if ` radix ` is not in the range from 2 to 36 .
examples
None
use js_int::{int, int};
None