pub struct BatchConfig {
pub batch_size: usize,
pub string_capacity: usize,
pub binary_capacity: usize,
pub coerce_types: bool,
}Expand description
Configuration for batch processing.
Controls memory allocation and processing behavior for batch conversion.
Fields§
§batch_size: usizeMaximum number of rows per batch.
Larger batches reduce overhead but use more memory. Default: 65536 (64K rows).
string_capacity: usizeInitial capacity for string builders (bytes).
Pre-allocating string capacity reduces reallocations. Default: 1MB.
binary_capacity: usizeInitial capacity for binary builders (bytes).
Pre-allocating binary capacity reduces reallocations. Default: 1MB.
coerce_types: boolWhether to coerce types when possible.
When true, numeric types may be widened (e.g., INT to BIGINT) to avoid precision loss. Default: false.
Implementations§
Source§impl BatchConfig
impl BatchConfig
Sourcepub fn with_batch_size(batch_size: usize) -> Self
pub fn with_batch_size(batch_size: usize) -> Self
Create a new configuration with the specified batch size.
Sourcepub const fn string_capacity(self, capacity: usize) -> Self
pub const fn string_capacity(self, capacity: usize) -> Self
Set the string builder capacity.
Sourcepub const fn binary_capacity(self, capacity: usize) -> Self
pub const fn binary_capacity(self, capacity: usize) -> Self
Set the binary builder capacity.
Sourcepub const fn coerce_types(self, coerce: bool) -> Self
pub const fn coerce_types(self, coerce: bool) -> Self
Enable or disable type coercion.
Trait Implementations§
Source§impl Clone for BatchConfig
impl Clone for BatchConfig
Source§fn clone(&self) -> BatchConfig
fn clone(&self) -> BatchConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for BatchConfig
impl Debug for BatchConfig
Auto Trait Implementations§
impl Freeze for BatchConfig
impl RefUnwindSafe for BatchConfig
impl Send for BatchConfig
impl Sync for BatchConfig
impl Unpin for BatchConfig
impl UnwindSafe for BatchConfig
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