pub struct BufView<'a> { /* private fields */ }
Expand description
A BufferView
into a Buf
.
A BufView
is constructed by Buf::buffer_view
, and implements
BufferView
, providing a view into the Buf
from which it was constructed.
Trait Implementations§
Source§impl<'a> BufferView<&'a [u8]> for BufView<'a>
impl<'a> BufferView<&'a [u8]> for BufView<'a>
Source§fn take_front(&mut self, n: usize) -> Option<&'a [u8]>
fn take_front(&mut self, n: usize) -> Option<&'a [u8]>
Takes
n
bytes from the front of the buffer’s body. Read moreSource§fn take_back(&mut self, n: usize) -> Option<&'a [u8]>
fn take_back(&mut self, n: usize) -> Option<&'a [u8]>
Takes
n
bytes from the back of the buffer’s body. Read moreSource§fn into_rest(self) -> &'a [u8] ⓘ
fn into_rest(self) -> &'a [u8] ⓘ
Converts this view into a reference to the buffer’s body. Read more
Source§fn take_rest_front(&mut self) -> B
fn take_rest_front(&mut self) -> B
Takes the rest of the buffer’s body from the front. Read more
Source§fn take_rest_back(&mut self) -> B
fn take_rest_back(&mut self) -> B
Takes the rest of the buffer’s body from the back. Read more
Source§fn take_byte_front(&mut self) -> Option<u8>
fn take_byte_front(&mut self) -> Option<u8>
Takes a single byte of the buffer’s body from the front. Read more
Source§fn take_byte_back(&mut self) -> Option<u8>
fn take_byte_back(&mut self) -> Option<u8>
Takes a single byte of the buffer’s body from the back. Read more
Source§fn peek_obj_front<T>(&mut self) -> Option<&T>where
T: FromBytes + KnownLayout + Immutable + Unaligned,
fn peek_obj_front<T>(&mut self) -> Option<&T>where
T: FromBytes + KnownLayout + Immutable + Unaligned,
Peeks at an object at the front of the buffer’s body. Read more
Source§fn take_obj_front<T>(&mut self) -> Option<Ref<B, T>>where
T: KnownLayout + Immutable + Unaligned,
fn take_obj_front<T>(&mut self) -> Option<Ref<B, T>>where
T: KnownLayout + Immutable + Unaligned,
Takes an object from the front of the buffer’s body. Read more
Source§fn take_slice_front<T>(&mut self, n: usize) -> Option<Ref<B, [T]>>where
T: Immutable + Unaligned,
fn take_slice_front<T>(&mut self, n: usize) -> Option<Ref<B, [T]>>where
T: Immutable + Unaligned,
Takes a slice of objects from the front of the buffer’s body. Read more
Source§fn peek_obj_back<T>(&mut self) -> Option<&T>where
T: FromBytes + KnownLayout + Immutable + Unaligned,
fn peek_obj_back<T>(&mut self) -> Option<&T>where
T: FromBytes + KnownLayout + Immutable + Unaligned,
Peeks at an object at the back of the buffer’s body. Read more
Source§fn take_obj_back<T>(&mut self) -> Option<Ref<B, T>>where
T: Immutable + KnownLayout + Unaligned,
fn take_obj_back<T>(&mut self) -> Option<Ref<B, T>>where
T: Immutable + KnownLayout + Unaligned,
Takes an object from the back of the buffer’s body. Read more
Auto Trait Implementations§
impl<'a> Freeze for BufView<'a>
impl<'a> RefUnwindSafe for BufView<'a>
impl<'a> Send for BufView<'a>
impl<'a> Sync for BufView<'a>
impl<'a> Unpin for BufView<'a>
impl<'a> !UnwindSafe for BufView<'a>
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