pub struct ConnectionWriteBuffer { /* private fields */ }Expand description
Per-connection write buffer with coalescing and flush management.
Implementations§
Source§impl ConnectionWriteBuffer
impl ConnectionWriteBuffer
Sourcepub fn new(connection_id: u64, config: CoalesceConfig) -> Self
pub fn new(connection_id: u64, config: CoalesceConfig) -> Self
Create a new connection write buffer.
Sourcepub fn write_bytes(&mut self, data: Bytes)
pub fn write_bytes(&mut self, data: Bytes)
Write owned bytes.
Sourcepub fn should_flush(&self) -> bool
pub fn should_flush(&self) -> bool
Check if ready to flush.
Sourcepub fn as_io_slices(&self) -> Vec<IoSlice<'_>>
pub fn as_io_slices(&self) -> Vec<IoSlice<'_>>
Get IoSlices for all pending data.
Sourcepub fn pending_bytes(&self) -> usize
pub fn pending_bytes(&self) -> usize
Get total pending bytes.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ConnectionWriteBuffer
impl RefUnwindSafe for ConnectionWriteBuffer
impl Send for ConnectionWriteBuffer
impl Sync for ConnectionWriteBuffer
impl Unpin for ConnectionWriteBuffer
impl UnwindSafe for ConnectionWriteBuffer
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> Injectable for T
impl<T> Injectable for T
Source§fn type_id_of() -> TypeIdwhere
Self: Sized,
fn type_id_of() -> TypeIdwhere
Self: Sized,
Returns the TypeId of this type (for internal use)
Source§fn type_name_of() -> &'static strwhere
Self: Sized,
fn type_name_of() -> &'static strwhere
Self: Sized,
Returns the type name for debugging