pub struct BufferLease { /* private fields */ }Expand description
An exclusive writable pool lease. Its initialized length can be shortened after a read, without copying or borrowing the receiver. Drop returns storage to the pool; an I/O backend must retain this owner until its access retires. A lease keeps its backing slab alive even after the pool is dropped.
Implementations§
Source§impl BufferLease
impl BufferLease
Trait Implementations§
Source§impl AsMut<[u8]> for BufferLease
impl AsMut<[u8]> for BufferLease
Source§impl AsRef<[u8]> for BufferLease
impl AsRef<[u8]> for BufferLease
Source§impl Debug for BufferLease
impl Debug for BufferLease
Source§impl Drop for BufferLease
impl Drop for BufferLease
Source§impl IoBuf for BufferLease
impl IoBuf for BufferLease
Source§fn slice(self, range: impl RangeBounds<usize>) -> BufferSlice<Self>where
Self: Sized,
fn slice(self, range: impl RangeBounds<usize>) -> BufferSlice<Self>where
Self: Sized,
Limit an operation to an owned range without copying its bytes. Panics if the range is outside the initialized buffer.
impl IoBufMut for BufferLease
Source§impl ReceiveBuffer for BufferLease
impl ReceiveBuffer for BufferLease
Source§type Frozen = FrozenBuffer
type Frozen = FrozenBuffer
The read-only, cloneable owner produced by
freeze.Source§fn truncate(&mut self, length: usize)
fn truncate(&mut self, length: usize)
Shorten the initialized prefix after a completed receive. Panics if
length exceeds the current prefix. This must not move or replace the backing allocation.Source§fn freeze(self) -> FrozenBuffer
fn freeze(self) -> FrozenBuffer
Consume mutable access and return a read-only owner of the same bytes, without copying them.
impl Send for BufferLease
impl Sync for BufferLease
Auto Trait Implementations§
impl !RefUnwindSafe for BufferLease
impl !UnwindSafe for BufferLease
impl Freeze for BufferLease
impl Unpin for BufferLease
impl UnsafeUnpin for BufferLease
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