pub struct BytesQuilt { /* private fields */ }Expand description
A byte buffer that tracks the locations of random-access writes.
Implementations§
Source§impl BytesQuilt
impl BytesQuilt
Sourcepub fn with_capacity(capacity: usize) -> Self
pub fn with_capacity(capacity: usize) -> Self
Creates a new BytesQuilt with the specified capacity.
Sourcepub fn put_at(
&mut self,
offset: usize,
src: &[u8],
) -> Result<Option<MissingSegment>, Error>
pub fn put_at( &mut self, offset: usize, src: &[u8], ) -> Result<Option<MissingSegment>, Error>
Transfer bytes into self from src at offset.
The offset is given from the beginning of the buffer.
Sourcepub fn missing_segments(&self) -> impl '_ + Iterator<Item = MissingSegment>
pub fn missing_segments(&self) -> impl '_ + Iterator<Item = MissingSegment>
An iterator over each MissingSegment in the BytesQuilt.
Sourcepub fn into_inner(self) -> BytesMut
pub fn into_inner(self) -> BytesMut
Reassemble the inner BytesMut and return it.
Trait Implementations§
Source§impl Debug for BytesQuilt
impl Debug for BytesQuilt
Auto Trait Implementations§
impl Freeze for BytesQuilt
impl RefUnwindSafe for BytesQuilt
impl Send for BytesQuilt
impl Sync for BytesQuilt
impl Unpin for BytesQuilt
impl UnwindSafe for BytesQuilt
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