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

Method child

arrow-array/src/array/union_array.rs:250–254  ·  view source on GitHub ↗

Accesses the child array for `type_id`. # Panics Panics if the `type_id` provided is not present in the array's DataType in the `Union`.

(&self, type_id: i8)

Source from the content-addressed store, hash-verified

248 /// Panics if the `type_id` provided is not present in the array's DataType
249 /// in the `Union`.
250 pub fn child(&self, type_id: i8) -> &ArrayRef {
251 assert!((type_id as usize) < self.fields.len());
252 let boxed = &self.fields[type_id as usize];
253 boxed.as_ref().expect("invalid type id")
254 }
255
256 /// Returns the `type_id` for the array slot at `index`.
257 ///

Calls 1

as_refMethod · 0.45