[go: up one dir, main page]

Function lexical_core::atoi::atoi8_range

source ·
pub unsafe extern "C" fn atoi8_range(
    radix: u8,
    first: *const u8,
    last: *const u8
) -> i8
Expand description

Unchecked parser for a string-to-number conversion using pointer ranges.

Returns the parsed value, ignoring any trailing invalid digits, and explicitly wrapping on arithmetic overflow.

This parser is FFI-compatible, and therefore may be called externally from C code.

  • radix - Radix for the number parsing (normally 10).
  • first - Pointer to the start of the input data.
  • last - Pointer to the one-past-the-end of the input data.

Panics

If the radix feature is enabled, panics if radix is not in the range [2, 36]. If the radix feature is not enabled, panics if radix != 10.

Also panics if either pointer is null.