Struct ReadBuffer

struct ReadBuffer<CHUNK_SIZE: usize> { ... }

A FIFO buffer for reading packets from the network.

Implementations

impl<CHUNK_SIZE: usize> ReadBuffer<CHUNK_SIZE>

fn new() -> Self

Create a new empty input buffer.

fn with_capacity(capacity: usize) -> Self

Create a new empty input buffer with a given capacity.

fn from_partially_read(part: Vec<u8>) -> Self

Create a input buffer filled with previously read data.

fn as_cursor(self: &Self) -> &Cursor<Vec<u8>>

Get a cursor to the data storage.

fn as_cursor_mut(self: &mut Self) -> &mut Cursor<Vec<u8>>

Get a cursor to the mutable data storage.

fn into_vec(self: Self) -> Vec<u8>

Consume the ReadBuffer and get the internal storage.

fn read_from<S: Read>(self: &mut Self, stream: &mut S) -> IoResult<usize>

Read next portion of data from the given input stream.

impl<CHUNK_SIZE: usize> Buf for ReadBuffer<CHUNK_SIZE>

fn remaining(self: &Self) -> usize
fn chunk(self: &Self) -> &[u8]
fn advance(self: &mut Self, cnt: usize)

impl<CHUNK_SIZE: usize> Debug for ReadBuffer<CHUNK_SIZE>

fn fmt(self: &Self, f: &mut Formatter<'_>) -> Result

impl<CHUNK_SIZE: usize> Default for ReadBuffer<CHUNK_SIZE>

fn default() -> Self

impl<CHUNK_SIZE: usize> Freeze for ReadBuffer<CHUNK_SIZE>

impl<CHUNK_SIZE: usize> RefUnwindSafe for ReadBuffer<CHUNK_SIZE>

impl<CHUNK_SIZE: usize> Send for ReadBuffer<CHUNK_SIZE>

impl<CHUNK_SIZE: usize> Sync for ReadBuffer<CHUNK_SIZE>

impl<CHUNK_SIZE: usize> Unpin for ReadBuffer<CHUNK_SIZE>

impl<CHUNK_SIZE: usize> UnsafeUnpin for ReadBuffer<CHUNK_SIZE>

impl<CHUNK_SIZE: usize> UnwindSafe for ReadBuffer<CHUNK_SIZE>

impl<T> Any for ReadBuffer<CHUNK_SIZE>

fn type_id(self: &Self) -> TypeId

impl<T> Borrow for ReadBuffer<CHUNK_SIZE>

fn borrow(self: &Self) -> &T

impl<T> BorrowMut for ReadBuffer<CHUNK_SIZE>

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

impl<T> From for ReadBuffer<CHUNK_SIZE>

fn from(t: T) -> T

Returns the argument unchanged.

impl<T> Same for ReadBuffer<CHUNK_SIZE>

impl<T, U> Into for ReadBuffer<CHUNK_SIZE>

fn into(self: Self) -> U

Calls U::from(self).

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

impl<T, U> TryFrom for ReadBuffer<CHUNK_SIZE>

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

impl<T, U> TryInto for ReadBuffer<CHUNK_SIZE>

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

impl<V, T> VZip for ReadBuffer<CHUNK_SIZE>

fn vzip(self: Self) -> V