[−][src]Struct rouille::input::multipart::MultipartField
A field in a multipart request with its associated headers and data.
Fields
headers: FieldHeaders
The headers for this field, including the name, filename, and content-type, if provided.
Warning: Values are Client-Provided
Everything in this struct are values from the client and should be considered untrustworthy. This crate makes no effort to validate or sanitize any client inputs.
data: MultipartData<M>
The field's data.
Methods
impl<M> MultipartField<M> where
M: ReadEntry,
[src]
M: ReadEntry,
pub fn is_text(&self) -> bool
[src]
Returns true
if this field has no content-type or the content-type is text/...
.
This typically means it can be read to a string, but it could still be using an unsupported
character encoding, so decoding to String
needs to ensure that the data is valid UTF-8.
Note also that the field contents may be too large to reasonably fit in memory.
The .save()
adapter can be used to enforce a size limit.
Detecting character encodings by any means is (currently) beyond the scope of this crate.
pub fn next_entry(self) -> ReadEntryResult<M, MultipartField<M>>
[src]
Read the next entry in the request.
pub fn next_entry_inplace(
&mut self
) -> Result<Option<&mut MultipartField<M>>, Error> where
&'a mut M: ReadEntry,
[src]
&mut self
) -> Result<Option<&mut MultipartField<M>>, Error> where
&'a mut M: ReadEntry,
Update self
as the next entry.
Returns Ok(Some(self))
if another entry was read, Ok(None)
if the end of the body was
reached, and Err(e)
for any errors that occur.
Trait Implementations
impl<M> Debug for MultipartField<M> where
M: ReadEntry + Debug,
[src]
M: ReadEntry + Debug,
Auto Trait Implementations
impl<M> Unpin for MultipartField<M> where
M: Unpin,
M: Unpin,
impl<M> Sync for MultipartField<M> where
M: Sync,
M: Sync,
impl<M> Send for MultipartField<M> where
M: Send,
M: Send,
impl<M> UnwindSafe for MultipartField<M> where
M: UnwindSafe,
M: UnwindSafe,
impl<M> RefUnwindSafe for MultipartField<M> where
M: RefUnwindSafe,
M: RefUnwindSafe,
Blanket Implementations
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,