[−][src]Struct multipart::server::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: ReadEntry> MultipartField<M>
[src]
impl<M: ReadEntry> MultipartField<M>
pub fn is_text(&self) -> bool
[src]
pub fn is_text(&self) -> bool
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>
[src]
pub fn next_entry(self) -> ReadEntryResult<M>
Read the next entry in the request.
pub fn next_entry_inplace(&mut self) -> Result<Option<&mut Self>> where
&'a mut M: ReadEntry,
[src]
pub fn next_entry_inplace(&mut self) -> Result<Option<&mut Self>> 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 + ReadEntry> Debug for MultipartField<M>
[src]
impl<M: Debug + ReadEntry> Debug for MultipartField<M>
Auto Trait Implementations
impl<M> Send for MultipartField<M> where
M: Send,
impl<M> Send for MultipartField<M> where
M: Send,
impl<M> Sync for MultipartField<M> where
M: Sync,
impl<M> Sync for MultipartField<M> where
M: Sync,
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
impl<T, U> Into for T where
U: From<T>,
impl<T> From for T
[src]
impl<T> From for T
impl<T, U> TryFrom for T where
T: From<U>,
[src]
impl<T, U> TryFrom for T where
T: From<U>,
type Error = !
try_from
)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
impl<T> Borrow for T where
T: ?Sized,
[src]
impl<T> Borrow for T where
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
impl<T> BorrowMut for T where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
fn borrow_mut(&mut self) -> &mut T
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
try_from
)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
impl<T> Any for T where
T: 'static + ?Sized,
[src]
impl<T> Any for T where
T: 'static + ?Sized,
fn get_type_id(&self) -> TypeId
[src]
fn get_type_id(&self) -> TypeId
impl<T> Typeable for T where
T: Any,
impl<T> Typeable for T where
T: Any,
impl<T> DebugAny for T where
T: Any + Debug,
impl<T> DebugAny for T where
T: Any + Debug,
impl<T> UnsafeAny for T where
T: Any,
impl<T> UnsafeAny for T where
T: Any,