pub struct ConnectionBuffer { /* private fields */ }Implementations§
Source§impl ConnectionBuffer
impl ConnectionBuffer
pub fn new() -> Self
pub fn with_capacity(capacity: usize) -> Self
pub fn extend(&mut self, data: &[u8])
pub fn slice(&self, start: usize, len: usize) -> Bytes
pub fn consume(&mut self, len: usize)
Sourcepub fn compact(&mut self)
pub fn compact(&mut self)
Compact the buffer to reduce memory usage when oversized. Uses split_off pattern to avoid to_vec() allocation per standards §18.1.
pub fn as_slice(&self) -> &[u8] ⓘ
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn capacity(&self) -> usize
pub fn remaining(&self) -> usize
pub fn reserve(&mut self, additional: usize)
pub fn clear(&mut self)
pub fn get_write_buffer(&mut self, min_size: usize) -> &mut [u8] ⓘ
Sourcepub unsafe fn advance_write(&mut self, len: usize)
pub unsafe fn advance_write(&mut self, len: usize)
Advance the write position of the buffer.
§Safety
The caller must ensure that len bytes have been written to the
spare capacity returned by spare_capacity_mut().
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ConnectionBuffer
impl RefUnwindSafe for ConnectionBuffer
impl Send for ConnectionBuffer
impl Sync for ConnectionBuffer
impl Unpin for ConnectionBuffer
impl UnsafeUnpin for ConnectionBuffer
impl UnwindSafe for ConnectionBuffer
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> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
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