bitcoin_units::parse

Function int

source
pub fn int<T: Integer, S: AsRef<str> + Into<String>>(
    s: S,
) -> Result<T, ParseIntError>
Available on crate feature alloc only.
Expand description

Parses the input string as an integer returning an error carrying rich context.

If the caller owns String or Box<str> which is not used later it’s better to pass it as owned since it avoids allocation in error case.