jiff::util::parse

Function i64

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

Parses an i64 number from the beginning to the end of the given slice of ASCII digit characters.

If any byte in the given slice is not [0-9], then this returns an error. Similarly, if the number parsed does not fit into a i64, then this returns an error. Notably, this routine does not permit parsing a negative integer. (We use i64 because everything in this crate uses signed integers, and because a higher level routine might want to parse the sign and then apply it to the result of this routine.)