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

Method encode

arrow-json/src/writer/mod.rs:2283–2291  ·  view source on GitHub ↗
(&mut self, idx: usize, out: &mut Vec<u8>)

Source from the content-addressed store, hash-verified

2281
2282 impl Encoder for UnionEncoder {
2283 fn encode(&mut self, idx: usize, out: &mut Vec<u8>) {
2284 match &self.array[idx] {
2285 None => out.extend_from_slice(b"null"),
2286 Some(UnionValue::Int32(v)) => out.extend_from_slice(v.to_string().as_bytes()),
2287 Some(UnionValue::String(v)) => {
2288 out.extend_from_slice(format!("\"{v}\"").as_bytes())
2289 }
2290 }
2291 }
2292 }
2293
2294 #[derive(Debug)]

Callers 1

writeMethod · 0.45

Calls 6

extend_from_sliceMethod · 0.80
as_bytesMethod · 0.45
pushMethod · 0.45
valueMethod · 0.45
iterMethod · 0.45
lenMethod · 0.45

Tested by

no test coverage detected