pub struct BytesReader { /* private fields */ }

Implementations§

source§

impl BytesReader

source

pub fn new(input: BytesMut) -> Self

source

pub fn extend_from_slice(&mut self, extend: &[u8])

source

pub fn read_bytes( &mut self, bytes_num: usize ) -> Result<BytesMut, BytesReadError>

source

pub fn advance_bytes( &mut self, bytes_num: usize ) -> Result<BytesMut, BytesReadError>

source

pub fn read_bytes_cursor( &mut self, bytes_num: usize ) -> Result<Cursor<BytesMut>, BytesReadError>

source

pub fn advance_bytes_cursor( &mut self, bytes_num: usize ) -> Result<Cursor<BytesMut>, BytesReadError>

source

pub fn read_u8(&mut self) -> Result<u8, BytesReadError>

source

pub fn advance_u8(&mut self) -> Result<u8, BytesReadError>

source

pub fn read_u16<T: ByteOrder>(&mut self) -> Result<u16, BytesReadError>

source

pub fn read_u24<T: ByteOrder>(&mut self) -> Result<u32, BytesReadError>

source

pub fn advance_u24<T: ByteOrder>(&mut self) -> Result<u32, BytesReadError>

source

pub fn read_u32<T: ByteOrder>(&mut self) -> Result<u32, BytesReadError>

source

pub fn read_u48<T: ByteOrder>(&mut self) -> Result<u64, BytesReadError>

source

pub fn read_f64<T: ByteOrder>(&mut self) -> Result<f64, BytesReadError>

source

pub fn read_u64<T: ByteOrder>(&mut self) -> Result<u64, BytesReadError>

source

pub fn get(&self, index: usize) -> Result<u8, BytesReadError>

source

pub fn len(&self) -> usize

source

pub fn is_empty(&self) -> bool

source

pub fn extract_remaining_bytes(&mut self) -> BytesMut

source

pub fn get_remaining_bytes(&self) -> BytesMut

Auto Trait Implementations§

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

§

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.