pub struct BulkLoadRequest<'a, S>{ /* private fields */ }Expand description
A handler for a bulk insert data flow.
Implementations§
Source§impl<'a, S> BulkLoadRequest<'a, S>
impl<'a, S> BulkLoadRequest<'a, S>
Sourcepub async fn send(&mut self, row: TokenRow<'a>) -> Result<()>
pub async fn send(&mut self, row: TokenRow<'a>) -> Result<()>
Adds a new row to the bulk insert, flushing only when having a full packet of data.
A row that fails to encode is not sent, and the request stays usable.
Dropping the request without finalize cancels the bulk insert;
the connection stays usable.
§Warning
After the last row, finalize must be called to flush the buffered
data and for the data to actually be available in the table.
Sourcepub async fn finalize(self) -> Result<ExecuteResult>
pub async fn finalize(self) -> Result<ExecuteResult>
Ends the bulk load, flushing all pending data to the wire.
This method must be called after sending all the data to flush all pending data and to get the server actually to store the rows to the table.
Trait Implementations§
Auto Trait Implementations§
impl<'a, S> !RefUnwindSafe for BulkLoadRequest<'a, S>
impl<'a, S> !UnwindSafe for BulkLoadRequest<'a, S>
impl<'a, S> Freeze for BulkLoadRequest<'a, S>where
&'a mut Connection<S>: Freeze,
impl<'a, S> Send for BulkLoadRequest<'a, S>where
&'a mut Connection<S>: Send,
impl<'a, S> Sync for BulkLoadRequest<'a, S>where
&'a mut Connection<S>: Sync,
impl<'a, S> Unpin for BulkLoadRequest<'a, S>where
&'a mut Connection<S>: Unpin,
impl<'a, S> UnsafeUnpin for BulkLoadRequest<'a, S>where
&'a mut Connection<S>: UnsafeUnpin,
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