MCPcopy Create free account
hub / github.com/apache/avro-rs / encode

Function encode

avro/src/encode.rs:38–41  ·  view source on GitHub ↗

Encode a `Value` into avro format. NOTE** This will not perform schema validation. The value is assumed to be valid with regards to the schema. Schema are needed only to guide the encoding for complex type values.

(value: &Value, schema: &Schema, writer: &mut W)

Source from the content-addressed store, hash-verified

36/// be valid with regards to the schema. Schema are needed only to guide the
37/// encoding for complex type values.
38pub fn encode<W: Write>(value: &Value, schema: &Schema, writer: &mut W) -> AvroResult<usize> {
39 let rs = ResolvedSchema::try_from(schema)?;
40 encode_internal(value, schema, rs.get_names(), None, writer)
41}
42
43/// Encode `s` as the _bytes_ primitive type.
44///

Calls 2

encode_internalFunction · 0.85
get_namesMethod · 0.80