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.
Trait Implementations§
impl<'__pin> Unpin for BinaryCopyInWriterwhere
PinnedFieldsOf<__Origin<'__pin>>: Unpin,
Auto Trait Implementations§
impl Freeze for BinaryCopyInWriter
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