pub struct Form { /* private fields */ }Expand description
A multipart form. Build it, then hand it to Request::form.
Implementations§
Source§impl Form
impl Form
Sourcepub fn bytes(
self,
name: impl Into<String>,
filename: impl Into<String>,
content_type: impl Into<String>,
bytes: Vec<u8>,
) -> Self
pub fn bytes( self, name: impl Into<String>, filename: impl Into<String>, content_type: impl Into<String>, bytes: Vec<u8>, ) -> Self
A file part from bytes in memory.
Sourcepub fn file(
self,
name: impl Into<String>,
path: impl Into<PathBuf>,
content_type: impl Into<String>,
) -> Self
pub fn file( self, name: impl Into<String>, path: impl Into<PathBuf>, content_type: impl Into<String>, ) -> Self
A file part read from disk while the form is sent.
Sourcepub fn content_type(&self) -> String
pub fn content_type(&self) -> String
The Content-Type header value, boundary included.
Trait Implementations§
Auto Trait Implementations§
impl Forget for Form
impl Freeze for Form
impl Move for Form
impl RefUnwindSafe for Form
impl Send for Form
impl Sync for Form
impl Unpin for Form
impl UnsafeUnpin for Form
impl UnwindSafe for Form
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