pub struct SchemaBuilder {
fields: Vec<FieldRef>,
metadata: HashMap<String, String>,
}
Fields§
§fields: Vec<FieldRef>
§metadata: HashMap<String, String>
Implementations§
Source§impl SchemaBuilder
impl SchemaBuilder
Sourcepub fn new() -> Self
pub fn new() -> Self
Creates a new empty SchemaBuilder
Sourcepub fn with_capacity(capacity: usize) -> Self
pub fn with_capacity(capacity: usize) -> Self
Creates a new empty SchemaBuilder
with space for capacity
fields
Sourcepub fn push(&mut self, field: impl Into<FieldRef>)
pub fn push(&mut self, field: impl Into<FieldRef>)
Appends a FieldRef
to this SchemaBuilder
without checking for collision
Sourcepub fn metadata(&mut self) -> &HashMap<String, String>
pub fn metadata(&mut self) -> &HashMap<String, String>
Returns an immutable reference to the Map of custom metadata key-value pairs.
Sourcepub fn metadata_mut(&mut self) -> &mut HashMap<String, String>
pub fn metadata_mut(&mut self) -> &mut HashMap<String, String>
Returns a mutable reference to the Map of custom metadata key-value pairs.
Sourcepub fn try_merge(&mut self, field: &FieldRef) -> Result<(), ArrowError>
pub fn try_merge(&mut self, field: &FieldRef) -> Result<(), ArrowError>
Appends a FieldRef
to this SchemaBuilder
checking for collision
If an existing field exists with the same name, calls Field::try_merge
Sourcepub fn finish(self) -> Schema
pub fn finish(self) -> Schema
Consume this SchemaBuilder
yielding the final Schema
Trait Implementations§
Source§impl Debug for SchemaBuilder
impl Debug for SchemaBuilder
Source§impl Default for SchemaBuilder
impl Default for SchemaBuilder
Source§fn default() -> SchemaBuilder
fn default() -> SchemaBuilder
Returns the “default value” for a type. Read more
Source§impl Extend<Arc<Field>> for SchemaBuilder
impl Extend<Arc<Field>> for SchemaBuilder
Source§fn extend<T: IntoIterator<Item = FieldRef>>(&mut self, iter: T)
fn extend<T: IntoIterator<Item = FieldRef>>(&mut self, iter: T)
Extends a collection with the contents of an iterator. Read more
Source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
🔬This is a nightly-only experimental API. (
extend_one
)Extends a collection with exactly one element.
Source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
🔬This is a nightly-only experimental API. (
extend_one
)Reserves capacity in a collection for the given number of additional elements. Read more
Source§impl Extend<Field> for SchemaBuilder
impl Extend<Field> for SchemaBuilder
Source§fn extend<T: IntoIterator<Item = Field>>(&mut self, iter: T)
fn extend<T: IntoIterator<Item = Field>>(&mut self, iter: T)
Extends a collection with the contents of an iterator. Read more
Source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
🔬This is a nightly-only experimental API. (
extend_one
)Extends a collection with exactly one element.
Source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
🔬This is a nightly-only experimental API. (
extend_one
)Reserves capacity in a collection for the given number of additional elements. Read more
Source§impl From<&Fields> for SchemaBuilder
impl From<&Fields> for SchemaBuilder
Source§impl From<&Schema> for SchemaBuilder
impl From<&Schema> for SchemaBuilder
Source§impl From<Fields> for SchemaBuilder
impl From<Fields> for SchemaBuilder
Auto Trait Implementations§
impl Freeze for SchemaBuilder
impl RefUnwindSafe for SchemaBuilder
impl Send for SchemaBuilder
impl Sync for SchemaBuilder
impl Unpin for SchemaBuilder
impl UnwindSafe for SchemaBuilder
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more