[−][src]Struct c3p0_pg_async::pg_async::bb8::tokio_postgres::binary_copy::BinaryCopyInWriter
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 BinaryCopyInWriter>,
values: &'_ [&'_ (dyn ToSql + '_ + Sync)]
) -> Result<(), Error>
[src]
self: Pin<&'_ mut BinaryCopyInWriter>,
values: &'_ [&'_ (dyn ToSql + '_ + Sync)]
) -> Result<(), Error>
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 BinaryCopyInWriter>,
values: I
) -> Result<(), Error> where
I: IntoIterator<Item = &'a (dyn ToSql + 'a)>,
<I as IntoIterator>::IntoIter: ExactSizeIterator,
[src]
self: Pin<&'_ mut BinaryCopyInWriter>,
values: I
) -> Result<(), Error> where
I: IntoIterator<Item = &'a (dyn ToSql + 'a)>,
<I as IntoIterator>::IntoIter: ExactSizeIterator,
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 BinaryCopyInWriter>) -> 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]
__Origin<'__pin>: Unpin,
Auto Trait Implementations
impl !RefUnwindSafe for BinaryCopyInWriter
impl Send for BinaryCopyInWriter
impl Sync for BinaryCopyInWriter
impl !UnwindSafe for BinaryCopyInWriter
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,