Skip to main content

MultipartReaderAsync

Struct MultipartReaderAsync 

Source
pub struct MultipartReaderAsync<'b, R, const BUF: usize, const LINE: usize = 512, const MAX_HEADERS: usize = 16> { /* private fields */ }
Expand description

Drives a Parser from an embedded_io_async::Read with a BUF-byte buffer (BUF >= parser.min_buffer()).

Implementations§

Source§

impl<'b, R: Read, const BUF: usize, const LINE: usize, const MAX_HEADERS: usize> MultipartReaderAsync<'b, R, BUF, LINE, MAX_HEADERS>

Source

pub fn new(reader: R, parser: Parser<'b, LINE, MAX_HEADERS>) -> Self

Wraps reader.

Source

pub async fn next_event(&mut self) -> Result<Event<'_, '_>, ReadError<R::Error>>

Returns the next event, reading as needed. After Finished it keeps returning Finished; after an error it keeps returning it.

§Errors

See ReadError.

Source

pub fn parser(&self) -> &Parser<'b, LINE, MAX_HEADERS>

The wrapped parser.

Source

pub fn into_inner(self) -> R

Returns the reader.

Auto Trait Implementations§

§

impl<'b, R, const BUF: usize, const LINE: usize, const MAX_HEADERS: usize> Freeze for MultipartReaderAsync<'b, R, BUF, LINE, MAX_HEADERS>
where R: Freeze, Core<'b, BUF, LINE, MAX_HEADERS>: Freeze,

§

impl<'b, R, const BUF: usize, const LINE: usize, const MAX_HEADERS: usize> RefUnwindSafe for MultipartReaderAsync<'b, R, BUF, LINE, MAX_HEADERS>
where R: RefUnwindSafe, Core<'b, BUF, LINE, MAX_HEADERS>: RefUnwindSafe,

§

impl<'b, R, const BUF: usize, const LINE: usize, const MAX_HEADERS: usize> Send for MultipartReaderAsync<'b, R, BUF, LINE, MAX_HEADERS>
where R: Send, Core<'b, BUF, LINE, MAX_HEADERS>: Send,

§

impl<'b, R, const BUF: usize, const LINE: usize, const MAX_HEADERS: usize> Sync for MultipartReaderAsync<'b, R, BUF, LINE, MAX_HEADERS>
where R: Sync, Core<'b, BUF, LINE, MAX_HEADERS>: Sync,

§

impl<'b, R, const BUF: usize, const LINE: usize, const MAX_HEADERS: usize> Unpin for MultipartReaderAsync<'b, R, BUF, LINE, MAX_HEADERS>
where R: Unpin, Core<'b, BUF, LINE, MAX_HEADERS>: Unpin,

§

impl<'b, R, const BUF: usize, const LINE: usize, const MAX_HEADERS: usize> UnsafeUnpin for MultipartReaderAsync<'b, R, BUF, LINE, MAX_HEADERS>
where R: UnsafeUnpin, Core<'b, BUF, LINE, MAX_HEADERS>: UnsafeUnpin,

§

impl<'b, R, const BUF: usize, const LINE: usize, const MAX_HEADERS: usize> UnwindSafe for MultipartReaderAsync<'b, R, BUF, LINE, MAX_HEADERS>
where R: UnwindSafe, Core<'b, BUF, LINE, MAX_HEADERS>: 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 = !

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

fn try_from(value: U) -> Result<T, !>

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.