pub struct Part {
pub name: String,
pub filename: Option<String>,
pub content_type: Option<String>,
pub data: Bytes,
}Expand description
One field or file of the form
Fields§
§name: StringThe form field name
filename: Option<String>Set for file inputs; chosen by the client, so untrusted
content_type: Option<String>The part’s Content-Type, if sent; chosen by the client, so untrusted
data: BytesImplementations§
Source§impl Part
impl Part
pub fn is_file(&self) -> bool
Sourcepub fn safe_filename(&self) -> Option<String>
pub fn safe_filename(&self) -> Option<String>
The client’s file name reduced to something safe to display or use as a
download name: no directories, no control or special characters, no
leading dots, at most 120 characters. None if nothing is left.
Do not use it to build paths for storing the upload: generate your own name.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Part
impl RefUnwindSafe for Part
impl Send for Part
impl Sync for Part
impl Unpin for Part
impl UnsafeUnpin for Part
impl UnwindSafe for Part
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