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