pub struct SplittableBuffer { /* private fields */ }Expand description
A wrapper around OwnedBuffer that allows carving out independent child OwnedBuffers
and delivering the reconstructed original OwnedBuffer to a completion callback once all child
buffers have been dropped.
Implementations§
Source§impl SplittableBuffer
impl SplittableBuffer
Sourcepub fn remaining_range(&self) -> Range<usize> ⓘ
pub fn remaining_range(&self) -> Range<usize> ⓘ
Returns the remaining unallocated range available for splitting.
Sourcepub fn fill_zeros(&mut self, len: usize)
pub fn fill_zeros(&mut self, len: usize)
Zeroes the next len bytes in the buffer and advances the offset.
§Panics
Panics if len exceeds remaining_range.len().
Sourcepub fn take_prefix(&mut self, len: usize) -> (OwnedBuffer, SubHandle)
pub fn take_prefix(&mut self, len: usize) -> (OwnedBuffer, SubHandle)
Trait Implementations§
Source§impl Debug for SplittableBuffer
impl Debug for SplittableBuffer
impl Send for SplittableBuffer
impl Sync for SplittableBuffer
Auto Trait Implementations§
impl !RefUnwindSafe for SplittableBuffer
impl !UnwindSafe for SplittableBuffer
impl Freeze for SplittableBuffer
impl Unpin for SplittableBuffer
impl UnsafeUnpin for SplittableBuffer
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