pub struct StreamingMultipart { /* private fields */ }Expand description
Streaming multipart extractor for large file uploads.
Unlike Multipart, this extractor does not buffer the entire request body in memory before
parsing. It consumes the request body as a stream and yields one field at a time.
If a MultipartConfig is present in app state, its size and content-type limits are applied.
Implementations§
Source§impl StreamingMultipart
impl StreamingMultipart
Sourcepub async fn next_field(
&mut self,
) -> Result<Option<StreamingMultipartField<'static>>>
pub async fn next_field( &mut self, ) -> Result<Option<StreamingMultipartField<'static>>>
Get the next field from the multipart stream.
Consume or drop the previously returned field before calling this again.
Sourcepub fn field_count(&self) -> usize
pub fn field_count(&self) -> usize
Number of fields yielded so far.
Trait Implementations§
Source§impl FromRequest for StreamingMultipart
impl FromRequest for StreamingMultipart
Source§async fn from_request(req: &mut Request) -> Result<Self>
async fn from_request(req: &mut Request) -> Result<Self>
Extract from the full request
Auto Trait Implementations§
impl Freeze for StreamingMultipart
impl !RefUnwindSafe for StreamingMultipart
impl Send for StreamingMultipart
impl Sync for StreamingMultipart
impl Unpin for StreamingMultipart
impl UnsafeUnpin for StreamingMultipart
impl !UnwindSafe for StreamingMultipart
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more