pub struct CopyWriter<'a> { /* private fields */ }Expand description
COPY writer for streaming data into PostgreSQL via COPY FROM STDIN.
Implementations§
Source§impl<'a> CopyWriter<'a>
impl<'a> CopyWriter<'a>
Sourcepub fn write_data(&mut self, data: &[u8]) -> PgResult<()>
pub fn write_data(&mut self, data: &[u8]) -> PgResult<()>
Write a chunk of COPY data.
Sourcepub fn fail(self, reason: &str) -> PgResult<()>
pub fn fail(self, reason: &str) -> PgResult<()>
Abort the COPY operation with an error message.
Sends a CopyFail message to the server. The server will respond with an ErrorResponse and then ReadyForQuery. The connection remains usable after this call.
Auto Trait Implementations§
impl<'a> Freeze for CopyWriter<'a>
impl<'a> !RefUnwindSafe for CopyWriter<'a>
impl<'a> Send for CopyWriter<'a>
impl<'a> Sync for CopyWriter<'a>
impl<'a> Unpin for CopyWriter<'a>
impl<'a> UnsafeUnpin for CopyWriter<'a>
impl<'a> !UnwindSafe for CopyWriter<'a>
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