pub struct MultipartField {
pub name: String,
pub value: Option<String>,
pub file_content: Option<Vec<u8>>,
pub filename: Option<String>,
pub content_type: Option<String>,
}Expand description
A field in a multipart form.
Fields§
§name: StringField name.
value: Option<String>Field value (for text fields).
file_content: Option<Vec<u8>>File content (for file fields).
filename: Option<String>File name (for file fields).
content_type: Option<String>Content type.
Implementations§
Source§impl MultipartField
impl MultipartField
Sourcepub fn text(name: impl Into<String>, value: impl Into<String>) -> Self
pub fn text(name: impl Into<String>, value: impl Into<String>) -> Self
Create a new text field.
Sourcepub fn file(
name: impl Into<String>,
filename: impl Into<String>,
content: Vec<u8>,
) -> Self
pub fn file( name: impl Into<String>, filename: impl Into<String>, content: Vec<u8>, ) -> Self
Create a new file field.
Sourcepub fn content_type(self, content_type: impl Into<String>) -> Self
pub fn content_type(self, content_type: impl Into<String>) -> Self
Set the content type for this field.
Trait Implementations§
Source§impl Clone for MultipartField
impl Clone for MultipartField
Source§fn clone(&self) -> MultipartField
fn clone(&self) -> MultipartField
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for MultipartField
impl RefUnwindSafe for MultipartField
impl Send for MultipartField
impl Sync for MultipartField
impl Unpin for MultipartField
impl UnwindSafe for MultipartField
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