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

Function lookup_format

src/expr/src/scalar/func/encoding.rs:206–217  ·  view source on GitHub ↗
(s: &str)

Source from the content-addressed store, hash-verified

204}
205
206pub fn lookup_format(s: &str) -> Result<&'static dyn Format, EvalError> {
207 let s = UncasedStr::new(s);
208 if s == "base64" {
209 Ok(&Base64Format)
210 } else if s == "escape" {
211 Ok(&EscapeFormat)
212 } else if s == "hex" {
213 Ok(&HexFormat)
214 } else {
215 Err(EvalError::InvalidEncodingName(s.as_str().into()))
216 }
217}

Callers 2

encodeFunction · 0.85
decodeFunction · 0.85

Calls 1

as_strMethod · 0.45

Tested by

no test coverage detected