SplitByteSliceBufView

Struct SplitByteSliceBufView 

Source
pub struct SplitByteSliceBufView<B>(/* private fields */);
Expand description

An implementation of BufferView for SplitByteSlices.

Implementations§

Source§

impl<B> SplitByteSliceBufView<B>

Source

pub fn new(buf: B) -> Self

Source

pub fn into_inner(self) -> B

Trait Implementations§

Source§

impl<B: SplitByteSlice> AsRef<[u8]> for SplitByteSliceBufView<B>

Source§

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

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

impl<B: SplitByteSlice> BufferView<B> for SplitByteSliceBufView<B>

Source§

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

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

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

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

fn into_rest(self) -> B

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>(&self) -> Option<&T>

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>>

Takes an object from the front of the buffer’s body. Read more
Source§

fn take_owned_obj_front<T>(&mut self) -> Option<T>
where T: FromBytes,

Takes an owned copy of 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,

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>

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>>

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

fn take_owned_obj_back<T>(&mut self) -> Option<T>
where T: FromBytes,

Takes an owned copy of 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: Immutable + Unaligned,

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

Auto Trait Implementations§

§

impl<B> Freeze for SplitByteSliceBufView<B>
where B: Freeze,

§

impl<B> RefUnwindSafe for SplitByteSliceBufView<B>
where B: RefUnwindSafe,

§

impl<B> Send for SplitByteSliceBufView<B>
where B: Send,

§

impl<B> Sync for SplitByteSliceBufView<B>
where B: Sync,

§

impl<B> Unpin for SplitByteSliceBufView<B>
where B: Unpin,

§

impl<B> UnwindSafe for SplitByteSliceBufView<B>
where B: UnwindSafe,

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<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>,

Source§

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>,

Source§

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.