pub struct CopyInWriter<'a> { /* private fields */ }Expand description
A writer for COPY IN operations.
This struct holds the connection lock while sending data to ensure exclusive access during the COPY operation.
Implementations§
Source§impl CopyInWriter<'_>
impl CopyInWriter<'_>
Sourcepub fn send_direct(&mut self, data: &[u8]) -> Result<()>
pub 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
Returns Error (I/O) if writing to the underlying stream fails.
Sourcepub fn flush_stream(&mut self) -> Result<()>
pub fn flush_stream(&mut self) -> Result<()>
Sourcepub fn reserve_buffer(&mut self, capacity: usize)
pub fn reserve_buffer(&mut self, capacity: usize)
Reserves capacity in the write buffer to avoid reallocations.
Call this before bulk operations to pre-allocate buffer space.
Trait Implementations§
Auto Trait Implementations§
impl<'a> !Send for CopyInWriter<'a>
impl<'a> Freeze for CopyInWriter<'a>
impl<'a> RefUnwindSafe for CopyInWriter<'a>
impl<'a> Sync for CopyInWriter<'a>
impl<'a> Unpin for CopyInWriter<'a>
impl<'a> UnsafeUnpin for CopyInWriter<'a>
impl<'a> UnwindSafe for CopyInWriter<'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