Function flussab::text::signed_ascii_digits[][src]

pub fn signed_ascii_digits<I>(
    reader: &mut ByteReader<'_>,
    offset: usize
) -> (Option<I>, usize) where
    I: Zero + FromPrimitive + OverflowingAdd + OverflowingSub + OverflowingMul

Passes over ASCII digits, optionally prefixed by '-’, and parses them as decimal number.

If offset points to a '-' character followed by at least one digit, this returns ascii_digits(input, offset + 1) with the parsed value negated (except that None is only returned if the final result would overflow). Otherwise this returns ascii_digits(input, offset). In particular this means that this will not advance over a lone '-' character that is not followed by a digit.

This also does not handle an explicit positive sign '+'.