Struct laminarmq_io::anchored_buffer::AnchoredBuffer
source · pub struct AnchoredBuffer<P> { /* private fields */ }
Implementations§
source§impl<P> AnchoredBuffer<P>where
P: Quantifier,
impl<P> AnchoredBuffer<P>where
P: Quantifier,
pub fn anchor_position(&self) -> P
pub fn end_position(&self) -> Result<P, BufferError>
pub fn offset(&self, position: P) -> Option<usize>
pub fn avail_to_read_from_pos(&self, position: P) -> usize
pub fn contains_position(&self, position: P) -> bool
pub fn contains_position_within_capacity(&self, position: P) -> bool
pub fn re_anchor(&mut self, new_anchor_position: P)
pub fn read_at<S>(
&mut self,
position: P,
size: S,
) -> Result<ReadBytes<Bytes, S>, BufferError>where
S: Quantifier,
pub fn truncate(&mut self, position: P) -> Result<(), BufferError>
Methods from Deref<Target = Buffer>§
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn capacity(&self) -> usize
pub fn avail_to_append(&self) -> usize
pub fn get_read_slice<R>(&mut self, range: R) -> Result<Bytes, BufferError>where
R: RangeBounds<usize>,
pub fn get_append_slice_mut(&mut self) -> Result<BytesMut, BufferError>
pub fn unsplit_append_slice( &mut self, append_bytes_mut: BytesMut, bytes_written: usize, ) -> Result<(), BufferError>
pub fn clear(&mut self)
pub fn contains(&self, pos: usize) -> bool
pub fn contains_within_capacity(&self, pos: usize) -> bool
pub fn truncate(&mut self, pos: usize) -> Result<(), BufferError>
Trait Implementations§
source§impl<P> Deref for AnchoredBuffer<P>
impl<P> Deref for AnchoredBuffer<P>
Auto Trait Implementations§
impl<P> !Freeze for AnchoredBuffer<P>
impl<P> RefUnwindSafe for AnchoredBuffer<P>where
P: RefUnwindSafe,
impl<P> Send for AnchoredBuffer<P>where
P: Send,
impl<P> Sync for AnchoredBuffer<P>where
P: Sync,
impl<P> Unpin for AnchoredBuffer<P>where
P: Unpin,
impl<P> UnwindSafe for AnchoredBuffer<P>where
P: UnwindSafe,
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreCreates a shared type from an unshared type.