Struct SchemaBuilder
pub struct SchemaBuilder {
fields: Vec<Arc<Field>>,
metadata: HashMap<String, String>,
}
Fields§
§fields: Vec<Arc<Field>>
§metadata: HashMap<String, String>
Implementations§
§impl SchemaBuilder
impl SchemaBuilder
pub fn new() -> SchemaBuilder
pub fn new() -> SchemaBuilder
Creates a new empty SchemaBuilder
pub fn with_capacity(capacity: usize) -> SchemaBuilder
pub fn with_capacity(capacity: usize) -> SchemaBuilder
Creates a new empty SchemaBuilder
with space for capacity
fields
pub fn push(&mut self, field: impl Into<Arc<Field>>)
pub fn push(&mut self, field: impl Into<Arc<Field>>)
Appends a FieldRef
to this SchemaBuilder
without checking for collision
pub 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.
pub 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.
pub fn reverse(&mut self)
pub fn reverse(&mut self)
Reverse the fileds
pub fn try_merge(&mut self, field: &Arc<Field>) -> Result<(), ArrowError>
pub fn try_merge(&mut self, field: &Arc<Field>) -> Result<(), ArrowError>
Appends a FieldRef
to this SchemaBuilder
checking for collision
If an existing field exists with the same name, calls Field::try_merge
pub fn finish(self) -> Schema
pub fn finish(self) -> Schema
Consume this SchemaBuilder
yielding the final Schema
Trait Implementations§
§impl Debug for SchemaBuilder
impl Debug for SchemaBuilder
§impl Default for SchemaBuilder
impl Default for SchemaBuilder
§fn default() -> SchemaBuilder
fn default() -> SchemaBuilder
Returns the “default value” for a type. Read more
§impl Extend<Arc<Field>> for SchemaBuilder
impl Extend<Arc<Field>> for SchemaBuilder
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
§impl Extend<Field> for SchemaBuilder
impl Extend<Field> for SchemaBuilder
§fn extend<T>(&mut self, iter: T)where
T: IntoIterator<Item = Field>,
fn extend<T>(&mut self, iter: T)where
T: IntoIterator<Item = Field>,
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
§impl From<&Fields> for SchemaBuilder
impl From<&Fields> for SchemaBuilder
§fn from(value: &Fields) -> SchemaBuilder
fn from(value: &Fields) -> SchemaBuilder
Converts to this type from the input type.
§impl From<&Schema> for SchemaBuilder
impl From<&Schema> for SchemaBuilder
§fn from(value: &Schema) -> SchemaBuilder
fn from(value: &Schema) -> SchemaBuilder
Converts to this type from the input type.
§impl From<Fields> for SchemaBuilder
impl From<Fields> for SchemaBuilder
§fn from(value: Fields) -> SchemaBuilder
fn from(value: Fields) -> SchemaBuilder
Converts to this type from the input type.
§impl From<Schema> for SchemaBuilder
impl From<Schema> for SchemaBuilder
§fn from(value: Schema) -> SchemaBuilder
fn from(value: Schema) -> SchemaBuilder
Converts to this type from the input type.
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