pub struct FrozenBuffer { /* private fields */ }Expand description
An immutable pool-backed chunk. Cloning or retaining a range shares its existing allocation; the final view returns the slot to the pool. Views keep the backing slab alive even after the pool is dropped, so parsers may choose to copy unusually long-lived fragments.
Implementations§
Source§impl FrozenBuffer
impl FrozenBuffer
Sourcepub fn view(&self, range: impl RangeBounds<usize>) -> BufferSlice<Self>
pub fn view(&self, range: impl RangeBounds<usize>) -> BufferSlice<Self>
Retain an independently owned range without copying payload bytes or allocating a reference-count wrapper.
Trait Implementations§
Source§impl AsRef<[u8]> for FrozenBuffer
impl AsRef<[u8]> for FrozenBuffer
Source§impl Clone for FrozenBuffer
impl Clone for FrozenBuffer
Source§impl Debug for FrozenBuffer
impl Debug for FrozenBuffer
Source§impl Drop for FrozenBuffer
impl Drop for FrozenBuffer
Source§impl IoBuf for FrozenBuffer
impl IoBuf for FrozenBuffer
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 Send for FrozenBuffer
impl Sync for FrozenBuffer
Auto Trait Implementations§
impl !RefUnwindSafe for FrozenBuffer
impl !UnwindSafe for FrozenBuffer
impl Freeze for FrozenBuffer
impl Unpin for FrozenBuffer
impl UnsafeUnpin for FrozenBuffer
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