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

Method parse_map

src/avro/src/schema.rs:1263–1273  ·  view source on GitHub ↗

Parse a `serde_json::Value` representing a Avro map type into a `Schema`.

(
        &mut self,
        default_namespace: &str,
        complex: &Map<String, Value>,
    )

Source from the content-addressed store, hash-verified

1261 /// Parse a `serde_json::Value` representing a Avro map type into a
1262 /// `Schema`.
1263 fn parse_map(
1264 &mut self,
1265 default_namespace: &str,
1266 complex: &Map<String, Value>,
1267 ) -> Result<SchemaPiece, AvroError> {
1268 complex
1269 .get("values")
1270 .ok_or_else(|| ParseSchemaError::new("No `values` in map").into())
1271 .and_then(|items| self.parse_inner(default_namespace, items))
1272 .map(|schema| SchemaPiece::Map(Box::new(schema)))
1273 }
1274
1275 /// Parse a `serde_json::Value` representing a Avro union type into a
1276 /// `Schema`.

Callers 1

parse_complexMethod · 0.45

Calls 4

parse_innerMethod · 0.80
MapClass · 0.50
mapMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected