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

Function encode

src/avro/src/encode.rs:33–35  ·  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, buffer: &mut Vec<u8>)

Source from the content-addressed store, hash-verified

31/// be valid with regards to the schema. Schema are needed only to guide the
32/// encoding for complex type values.
33pub fn encode(value: &Value, schema: &Schema, buffer: &mut Vec<u8>) {
34 encode_ref(value, schema.top_node(), buffer)
35}
36
37fn encode_bytes<B: AsRef<[u8]> + ?Sized>(s: &B, buffer: &mut Vec<u8>) {
38 let bytes = s.as_ref();

Callers 15

encode_bytesFunction · 0.70
encode_to_vecFunction · 0.70
test_encode_empty_arrayFunction · 0.70
test_encode_empty_mapFunction · 0.70
headerMethod · 0.70
write_avro_datumFunction · 0.70
new_field_in_middleFunction · 0.70
new_field_at_endFunction · 0.70
default_non_numsFunction · 0.70
purify_create_sourceFunction · 0.50
schema_to_codecFunction · 0.50

Calls 2

encode_refFunction · 0.85
top_nodeMethod · 0.80

Tested by 4

test_encode_empty_arrayFunction · 0.56
test_encode_empty_mapFunction · 0.56
test_compactionFunction · 0.40
test_snapshot_statsFunction · 0.40