Available on crate feature
alloc
only.Expand description
Parsing utilities.
Structs§
- Error when hex string contains a prefix (e.g. 0x).
- Error returned when a hex string is missing a prefix (e.g.
0x
). - Error with rich context returned when a string can’t be parsed as an integer.
Enums§
- Error returned when parsing an integer from a hex string that is supposed to contain a prefix.
- Error returned when parsing an integer from a hex string that is not supposed to contain a prefix.
Traits§
- Not strictly necessary but serves as a lint - avoids weird behavior if someone accidentally passes non-integer to the
parse()
function.
Functions§
- Checks a hex string does not have a prefix
0x
(or0X
). - Removes the prefix
0x
(or0X
) from a hex string. - Parses a
u32
from a hex string. - Parses a
u32
from a prefixed hex string. - Parses a
u32
from an unprefixed hex string without first checking for a prefix. - Parses a
u32
from an unprefixed hex string. - Parses a
u128
from a hex string. - Parses a
u128
from a hex string. - Parses a
u128
from an unprefixed hex string without first checking for a prefix. - Parses a
u128
from a hex string. - Parses the input string as an integer returning an error carrying rich context.