pub struct BatchManager { /* private fields */ }Expand description
Manages batched INSERT operations for multiple tables
Implementations§
Source§impl BatchManager
impl BatchManager
Sourcepub fn queue_insert(
&mut self,
table: &str,
columns: Option<Vec<String>>,
rows: Vec<Vec<ParsedValue>>,
original_sql: String,
) -> Option<InsertBatch>
pub fn queue_insert( &mut self, table: &str, columns: Option<Vec<String>>, rows: Vec<Vec<ParsedValue>>, original_sql: String, ) -> Option<InsertBatch>
Queue rows for insertion, returning a batch if it’s ready to flush
Sourcepub fn get_ready_batches(&mut self) -> Vec<InsertBatch>
pub fn get_ready_batches(&mut self) -> Vec<InsertBatch>
Get any batches that are ready to flush
Sourcepub fn drain_all(&mut self) -> Vec<InsertBatch>
pub fn drain_all(&mut self) -> Vec<InsertBatch>
Flush all remaining batches
Sourcepub fn has_pending(&self) -> bool
pub fn has_pending(&self) -> bool
Check if there are any pending batches
Auto Trait Implementations§
impl Freeze for BatchManager
impl RefUnwindSafe for BatchManager
impl Send for BatchManager
impl Sync for BatchManager
impl Unpin for BatchManager
impl UnwindSafe for BatchManager
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more