[][src]Struct tokio_postgres::binary_copy::BinaryCopyInWriter

pub struct BinaryCopyInWriter { /* fields omitted */ }

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.

Methods

impl BinaryCopyInWriter[src]

pub fn new(sink: CopyInSink<Bytes>, types: &[Type]) -> BinaryCopyInWriter[src]

Creates a new writer which will write rows of the provided types to the provided sink.

pub async fn write<'_, '_, '_>(
    self: Pin<&'_ mut Self>,
    values: &'_ [&'_ (dyn ToSql + Sync)]
) -> Result<(), Error>
[src]

Writes a single row.

Panics

Panics if the number of values provided does not match the number expected.

pub async fn write_raw<'a, '_, I>(
    self: Pin<&'_ mut Self>,
    values: I
) -> Result<(), Error> where
    I: IntoIterator<Item = &'a dyn ToSql>,
    I::IntoIter: ExactSizeIterator
[src]

A maximally-flexible version of write.

Panics

Panics if the number of values provided does not match the number expected.

pub async fn finish<'_>(self: Pin<&'_ mut Self>) -> Result<u64, Error>[src]

Completes the copy, returning the number of rows added.

This method must be used to complete the copy process. If it is not, the copy will be aborted.

Trait Implementations

impl<'__pin> Unpin for BinaryCopyInWriter where
    __Origin<'__pin>: Unpin
[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> Sealed<T> for T where
    T: ?Sized

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,