pub struct Reader<R: Read> { /* private fields */ }Expand description
Reads a MIME multipart body, iterating over its parts.
Port of Go’s multipart.NewReader.
Implementations§
Source§impl<R: Read> Reader<R>
impl<R: Read> Reader<R>
Sourcepub fn new(inner: R, boundary: &str) -> Self
pub fn new(inner: R, boundary: &str) -> Self
Create a new Reader with the given boundary (without leading --).
Sourcepub fn next_part(&mut self) -> Result<Option<Part<'_>>, MimeError>
pub fn next_part(&mut self) -> Result<Option<Part<'_>>, MimeError>
Advance to and return the next part, or None if the final boundary
has been reached or the body is exhausted.
Sourcepub fn read_form(&mut self, max_memory: i64) -> Result<Form, MimeError>
pub fn read_form(&mut self, max_memory: i64) -> Result<Form, MimeError>
Read all parts into a Form, respecting a memory budget.
Files larger than max_memory bytes are spilled to a Vec<u8> (no
actual temp-file in this implementation; matches Go’s in-memory path).
Port of Go’s (*Reader).ReadForm.
Auto Trait Implementations§
impl<R> Freeze for Reader<R>where
R: Freeze,
impl<R> RefUnwindSafe for Reader<R>where
R: RefUnwindSafe,
impl<R> Send for Reader<R>where
R: Send,
impl<R> Sync for Reader<R>where
R: Sync,
impl<R> Unpin for Reader<R>where
R: Unpin,
impl<R> UnsafeUnpin for Reader<R>where
R: UnsafeUnpin,
impl<R> UnwindSafe for Reader<R>where
R: UnwindSafe,
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