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

Function parse_int16

src/repr/src/strconv.rs:117–121  ·  view source on GitHub ↗

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

(s: &str)

Source from the content-addressed store, hash-verified

115/// Valid values are whatever the [`std::str::FromStr`] implementation on `i16` accepts,
116/// plus leading and trailing whitespace.
117pub fn parse_int16(s: &str) -> Result<i16, ParseError> {
118 s.trim()
119 .parse()
120 .map_err(|e| ParseError::invalid_input_syntax("smallint", s).with_details(e))
121}
122
123/// Writes an [`i16`] to `buf`.
124pub fn format_int16<F>(buf: &mut F, i: i16) -> Nestable

Callers 5

cast_string_to_int16Function · 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