pub struct Reader<IoImplementation, Inner, EofCondition, Buffer> {
    pub inner: Inner,
    pub buf: Buffer,
    pub phantom_data: PhantomData<(EofCondition, IoImplementation)>,
}
Expand description

A reader with an internal buffer.

Fields§

§inner: Inner

The inner reader.

§buf: Buffer

The buffer to use for reading the data.

§phantom_data: PhantomData<(EofCondition, IoImplementation)>

The phantom data for tracking the generic parameters that are not used directly in the struct definition.

Implementations§

source§

impl<IoImplementation, Inner, EofCondition, Buffer> Reader<IoImplementation, Inner, EofCondition, Buffer>

source

pub fn new(inner: Inner, buf: Buffer) -> Self

Create an instance of a Reader with the specified parameters.

Trait Implementations§

source§

impl<IoImplementation: Debug, Inner: Debug, EofCondition: Debug, Buffer: Debug> Debug for Reader<IoImplementation, Inner, EofCondition, Buffer>

source§

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

Formats the value using the given formatter. Read more
source§

impl<Inner, EofCondition> Reader for Reader<Tokio, Inner, EofCondition, BytesMut>where Inner: AsyncRead + Unpin, EofCondition: EofCondition<Result<usize, Error>>,

§

type Data<'data> = Bytes

The chunk data.
§

type Error = Error

The error that can originate at the reader.
source§

async fn next(&mut self) -> Option<Result<Self::Data<'_>, Self::Error>>

Read next chunk of data. If there is no more data to read - returns None.

Auto Trait Implementations§

§

impl<IoImplementation, Inner, EofCondition, Buffer> RefUnwindSafe for Reader<IoImplementation, Inner, EofCondition, Buffer>where Buffer: RefUnwindSafe, EofCondition: RefUnwindSafe, Inner: RefUnwindSafe, IoImplementation: RefUnwindSafe,

§

impl<IoImplementation, Inner, EofCondition, Buffer> Send for Reader<IoImplementation, Inner, EofCondition, Buffer>where Buffer: Send, EofCondition: Send, Inner: Send, IoImplementation: Send,

§

impl<IoImplementation, Inner, EofCondition, Buffer> Sync for Reader<IoImplementation, Inner, EofCondition, Buffer>where Buffer: Sync, EofCondition: Sync, Inner: Sync, IoImplementation: Sync,

§

impl<IoImplementation, Inner, EofCondition, Buffer> Unpin for Reader<IoImplementation, Inner, EofCondition, Buffer>where Buffer: Unpin, EofCondition: Unpin, Inner: Unpin, IoImplementation: Unpin,

§

impl<IoImplementation, Inner, EofCondition, Buffer> UnwindSafe for Reader<IoImplementation, Inner, EofCondition, Buffer>where Buffer: UnwindSafe, EofCondition: UnwindSafe, Inner: UnwindSafe, IoImplementation: UnwindSafe,

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere 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 Twhere 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 Twhere 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 Twhere 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.