Struct tokio_postgres::binary_copy::BinaryCopyInWriter
source · pub struct BinaryCopyInWriter { /* private fields */ }
Expand description
A type which serializes rows into the PostgreSQL binary copy format.
The copy must be explicitly completed via the finish
method. If it is not, the copy will be aborted.
Implementations§
source§impl BinaryCopyInWriter
impl BinaryCopyInWriter
sourcepub fn new(sink: CopyInSink<Bytes>, types: &[Type]) -> BinaryCopyInWriter
pub fn new(sink: CopyInSink<Bytes>, types: &[Type]) -> BinaryCopyInWriter
Creates a new writer which will write rows of the provided types to the provided sink.
sourcepub async fn write(
self: Pin<&mut Self>,
values: &[&(dyn ToSql + Sync)]
) -> Result<(), Error>
pub async fn write( self: Pin<&mut Self>, values: &[&(dyn ToSql + Sync)] ) -> Result<(), Error>
Writes a single row.
Panics
Panics if the number of values provided does not match the number expected.
sourcepub async fn write_raw<P, I>(
self: Pin<&mut Self>,
values: I
) -> Result<(), Error>where
P: BorrowToSql,
I: IntoIterator<Item = P>,
I::IntoIter: ExactSizeIterator,
pub async fn write_raw<P, I>( self: Pin<&mut Self>, values: I ) -> Result<(), Error>where P: BorrowToSql, I: IntoIterator<Item = P>, I::IntoIter: ExactSizeIterator,
A maximally-flexible version of write
.
Panics
Panics if the number of values provided does not match the number expected.
Trait Implementations§
impl<'__pin> Unpin for BinaryCopyInWriterwhere __Origin<'__pin>: Unpin,
Auto Trait Implementations§
impl !RefUnwindSafe for BinaryCopyInWriter
impl Send for BinaryCopyInWriter
impl Sync for BinaryCopyInWriter
impl !UnwindSafe for BinaryCopyInWriter
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