fraction

Function fraction 

Source
pub(crate) fn fraction(bytes: &[u8]) -> Result<u32, Error>
Expand description

Parses a u32 fractional number from the beginning to the end of the given slice of ASCII digit characters.

The fraction’s maximum precision is always 9 digits. The returned integer will always be in units of 10^{max_precision}. For example, this will parse a fractional amount of seconds with a maximum precision of nanoseconds.

If any byte in the given slice is not [0-9], then this returns an error. Notably, this routine does not permit parsing a negative integer.