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

Function parse_date

src/repr/src/strconv.rs:409–414  ·  view source on GitHub ↗

Parses a [`Date`] from `s`.

(s: &str)

Source from the content-addressed store, hash-verified

407
408/// Parses a [`Date`] from `s`.
409pub fn parse_date(s: &str) -> Result<Date, ParseError> {
410 match parse_timestamp_string(s) {
411 Ok((date, _, _)) => Date::try_from(date).map_err(|_| ParseError::out_of_range("date", s)),
412 Err(e) => Err(ParseError::invalid_input_syntax("date", s).with_details(e)),
413 }
414}
415
416/// Writes a [`Date`] to `buf`.
417pub fn format_date<F>(buf: &mut F, d: Date) -> Nestable

Callers 5

cast_string_to_dateFunction · 0.85
decode_textMethod · 0.85
decode_text_into_rowMethod · 0.85
from_strMethod · 0.85
evalMethod · 0.85

Calls 2

parse_timestamp_stringFunction · 0.85
with_detailsMethod · 0.80

Tested by

no test coverage detected