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

Method from_fields

arrow-array/src/builder/struct_builder.rs:177–184  ·  view source on GitHub ↗

Creates a new `StructBuilder` from [`Fields`] and `capacity`

(fields: impl Into<Fields>, capacity: usize)

Source from the content-addressed store, hash-verified

175
176 /// Creates a new `StructBuilder` from [`Fields`] and `capacity`
177 pub fn from_fields(fields: impl Into<Fields>, capacity: usize) -> Self {
178 let fields = fields.into();
179 let mut builders = Vec::with_capacity(fields.len());
180 for field in &fields {
181 builders.push(make_builder(field.data_type(), capacity));
182 }
183 Self::new(fields, builders)
184 }
185
186 /// Returns a mutable reference to the child field builder at index `i`.
187 /// Result will be `None` if the input type `T` provided doesn't match the actual

Callers

nothing calls this directly

Calls 4

make_builderFunction · 0.85
lenMethod · 0.45
pushMethod · 0.45
data_typeMethod · 0.45

Tested by

no test coverage detected