MCPcopy Create free account
hub / github.com/It4innovations/hyperqueue / parse_u32

Function parse_u32

crates/hyperqueue/src/common/parser2.rs:233–238  ·  view source on GitHub ↗

Parse 4-byte integer.

()

Source from the content-addressed store, hash-verified

231
232/// Parse 4-byte integer.
233pub fn parse_u32() -> impl CharParser<u32> {
234 parse_integer_string().try_map(|p, span| {
235 p.parse::<u32>()
236 .map_err(|_| ParseError::custom(span, "Cannot parse as 4-byte unsigned integer"))
237 })
238}
239
240/// Parse int32 or float with FRACTIONS_MAX_DIGITS precision (e.g. "2", "3.3", "0.0001")
241pub fn parse_resource_amount() -> impl CharParser<ResourceAmount> {

Callers 5

parse_resource_rangeFunction · 0.85
parse_rangeFunction · 0.85
parse_resource_amountFunction · 0.85
parse_hms_time_innerFunction · 0.85

Calls 1

parse_integer_stringFunction · 0.85

Tested by

no test coverage detected