Struct heph_rt::bytes::LimitedBytes
source · [−]pub struct LimitedBytes<B> { /* private fields */ }Expand description
Wrapper to limit the number of bytes B can use.
See Bytes::limit and BytesVectored::limit.
Implementations
sourceimpl<B> LimitedBytes<B>
impl<B> LimitedBytes<B>
sourcepub fn into_inner(self) -> B
pub fn into_inner(self) -> B
Returns the underlying buffer.
Trait Implementations
sourceimpl<B> Bytes for LimitedBytes<B>where
B: Bytes,
impl<B> Bytes for LimitedBytes<B>where
B: Bytes,
sourcefn as_bytes(&mut self) -> &mut [MaybeUninit<u8>]
fn as_bytes(&mut self) -> &mut [MaybeUninit<u8>]
Returns itself as a slice of bytes that may or may not be initialised. Read more
sourcefn spare_capacity(&self) -> usize
fn spare_capacity(&self) -> usize
sourcefn has_spare_capacity(&self) -> bool
fn has_spare_capacity(&self) -> bool
Returns
true if the buffer has spare capacity.sourceunsafe fn update_length(&mut self, n: usize)
unsafe fn update_length(&mut self, n: usize)
Update the length of the byte slice, marking
n bytes as initialised. Read moresourceimpl<B> BytesVectored for LimitedBytes<B>where
B: BytesVectored,
impl<B> BytesVectored for LimitedBytes<B>where
B: BytesVectored,
type Bufs<'b>
where
Self: 'b = <B as BytesVectored>::Bufs<'b>
type Bufs<'b>
where
Self: 'b = <B as BytesVectored>::Bufs<'b>
Type used as slice of buffers, usually this is an array.
sourcefn as_bufs<'b>(&'b mut self) -> Self::Bufs<'b>
fn as_bufs<'b>(&'b mut self) -> Self::Bufs<'b>
Returns itself as a slice of
MaybeUninitSlice.sourcefn spare_capacity(&self) -> usize
fn spare_capacity(&self) -> usize
sourcefn has_spare_capacity(&self) -> bool
fn has_spare_capacity(&self) -> bool
Returns
true if (one of) the buffers has spare capacity.sourceunsafe fn update_lengths(&mut self, n: usize)
unsafe fn update_lengths(&mut self, n: usize)
Update the length of the buffers in the slice. Read more
Auto Trait Implementations
impl<B> RefUnwindSafe for LimitedBytes<B>where
B: RefUnwindSafe,
impl<B> Send for LimitedBytes<B>where
B: Send,
impl<B> Sync for LimitedBytes<B>where
B: Sync,
impl<B> Unpin for LimitedBytes<B>where
B: Unpin,
impl<B> UnwindSafe for LimitedBytes<B>where
B: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more