pub struct AsyncCopyInWriter<'a> { /* private fields */ }Expand description
Async COPY IN writer for bulk data insertion.
§Drop Safety
If this writer is dropped without calling finish() or
cancel(), it will attempt a best-effort synchronous cancel
by queuing a CopyFail message in the connection’s write buffer. The next
async operation on the connection will flush and drain the cancel response,
restoring the connection to a usable state.
Implementations§
Source§impl<'a> AsyncCopyInWriter<'a>
impl<'a> AsyncCopyInWriter<'a>
Sourcepub async fn send(&mut self, data: &[u8]) -> Result<()>
pub async fn send(&mut self, data: &[u8]) -> Result<()>
Sends data to the server.
§Errors
Currently infallible — frame construction is pure. The Result
return type is preserved for forward compatibility.
Sourcepub async fn send_direct(&mut self, data: &[u8]) -> Result<()>
pub async fn send_direct(&mut self, data: &[u8]) -> Result<()>
Sends COPY data directly to the stream without internal buffering.
This writes data directly to the TCP stream, letting the kernel handle
buffering. More efficient for streaming large amounts of data.
Call flush_stream() periodically to ensure data is sent.
§Errors
Sourcepub async fn flush_stream(&mut self) -> Result<()>
pub async fn flush_stream(&mut self) -> Result<()>
Trait Implementations§
Source§impl<'a> Debug for AsyncCopyInWriter<'a>
impl<'a> Debug for AsyncCopyInWriter<'a>
Source§impl Drop for AsyncCopyInWriter<'_>
impl Drop for AsyncCopyInWriter<'_>
Auto Trait Implementations§
impl<'a> Freeze for AsyncCopyInWriter<'a>
impl<'a> !RefUnwindSafe for AsyncCopyInWriter<'a>
impl<'a> Send for AsyncCopyInWriter<'a>
impl<'a> Sync for AsyncCopyInWriter<'a>
impl<'a> Unpin for AsyncCopyInWriter<'a>
impl<'a> UnsafeUnpin for AsyncCopyInWriter<'a>
impl<'a> !UnwindSafe for AsyncCopyInWriter<'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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request