MCPcopy Create free account
hub / github.com/MaterializeInc/materialize / parse_int32

Function parse_int32

src/repr/src/strconv.rs:136–140  ·  view source on GitHub ↗

Parses an [`i32`] from `s`. Valid values are whatever the [`std::str::FromStr`] implementation on `i32` accepts, plus leading and trailing whitespace.

(s: &str)

Source from the content-addressed store, hash-verified

134/// Valid values are whatever the [`std::str::FromStr`] implementation on `i32` accepts,
135/// plus leading and trailing whitespace.
136pub fn parse_int32(s: &str) -> Result<i32, ParseError> {
137 s.trim()
138 .parse()
139 .map_err(|e| ParseError::invalid_input_syntax("integer", s).with_details(e))
140}
141
142/// Writes an [`i32`] to `buf`.
143pub fn format_int32<F>(buf: &mut F, i: i32) -> Nestable

Callers 5

cast_string_to_int32Function · 0.85
decode_textMethod · 0.85
decode_text_into_rowMethod · 0.85
cell_from_tokenFunction · 0.85
evalMethod · 0.85

Calls 3

with_detailsMethod · 0.80
parseMethod · 0.45
trimMethod · 0.45

Tested by

no test coverage detected