pub struct BufViewMut<'a> { /* private fields */ }
Expand description

A BufferViewMut into a Buf.

A BufViewMut is constructed by Buf::buffer_view_mut, and implements BufferViewMut, providing a mutable view into the Buf from which it was constructed.

Trait Implementations§

source§

impl<'a> AsMut<[u8]> for BufViewMut<'a>

source§

fn as_mut(&mut self) -> &mut [u8]

Converts this type into a mutable reference of the (usually inferred) input type.
source§

impl<'a> AsRef<[u8]> for BufViewMut<'a>

source§

fn as_ref(&self) -> &[u8]

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl<'a> BufferView<&'a mut [u8]> for BufViewMut<'a>

source§

fn take_front(&mut self, n: usize) -> Option<&'a mut [u8]>

Takes n bytes from the front of the buffer’s body. Read more
source§

fn take_back(&mut self, n: usize) -> Option<&'a mut [u8]>

Takes n bytes from the back of the buffer’s body. Read more
source§

fn into_rest(self) -> &'a mut [u8]

Converts this view into a reference to the buffer’s body. Read more
source§

fn len(&self) -> usize

The length of the buffer’s body.
source§

fn is_empty(&self) -> bool

Is the buffer’s body empty?
source§

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

Takes the rest of the buffer’s body from the back. Read more
source§

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>

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 + NoCell + 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: 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: 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 + NoCell + 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: Unaligned,

Takes an object from the back of the buffer’s body. Read more
source§

fn take_slice_back<T>(&mut self, n: usize) -> Option<Ref<B, [T]>>
where T: Unaligned,

Takes a slice of objects from the back of the buffer’s body. Read more
source§

impl<'a> BufferViewMut<&'a mut [u8]> for BufViewMut<'a>

source§

fn take_front_zero(&mut self, n: usize) -> Option<B>

Takes n bytes from the front of the buffer’s body and zeroes them. Read more
source§

fn take_back_zero(&mut self, n: usize) -> Option<B>

Takes n bytes from the back of the buffer’s body and zeroes them. Read more
source§

fn take_rest_front_zero(self) -> B

Takes the rest of the buffer’s body from the front and zeroes it. Read more
source§

fn take_rest_back_zero(self) -> B

Takes the rest of the buffer’s body from the back and zeroes it. Read more
source§

fn into_rest_zero(self) -> B

Converts this view into a reference to the buffer’s body, and zeroes it. Read more
source§

fn take_obj_front_zero<T>(&mut self) -> Option<Ref<B, T>>
where T: Unaligned,

Takes an object from the front of the buffer’s body and zeroes it. Read more
source§

fn take_obj_back_zero<T>(&mut self) -> Option<Ref<B, T>>
where T: Unaligned,

Takes an object from the back of the buffer’s body and zeroes it. Read more
source§

fn write_obj_front<T>(&mut self, obj: &T) -> Option<()>
where T: ?Sized + AsBytes + NoCell,

Writes an object to the front of the buffer’s body, consuming the bytes. Read more
source§

fn write_obj_back<T>(&mut self, obj: &T) -> Option<()>
where T: ?Sized + AsBytes + NoCell,

Writes an object to the back of the buffer’s body, consuming the bytes. Read more

Auto Trait Implementations§

§

impl<'a> Freeze for BufViewMut<'a>

§

impl<'a> RefUnwindSafe for BufViewMut<'a>

§

impl<'a> Send for BufViewMut<'a>

§

impl<'a> Sync for BufViewMut<'a>

§

impl<'a> Unpin for BufViewMut<'a>

§

impl<'a> !UnwindSafe for BufViewMut<'a>

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<O, B> AsFragmentedByteSlice<B> for O
where B: Fragment, O: AsMut<[B]>,

source§

fn as_fragmented_byte_slice(&mut self) -> FragmentedByteSlice<'_, B>

Generates a FragmentedByteSlice view of self.
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.