pub struct Multipart { /* private fields */ }Implementations§
Source§impl Multipart
impl Multipart
Sourcepub fn with_boundary(boundary: impl Into<String>) -> Self
pub fn with_boundary(boundary: impl Into<String>) -> Self
A form with a pinned boundary (for byte-exact tests and replays). The
boundary must be 1 to 70 characters from ASCII letters, digits, -, _, ., +.
Sourcepub fn file_bytes(
self,
name: &str,
filename: &str,
content_type: &str,
bytes: impl Into<Vec<u8>>,
) -> Self
pub fn file_bytes( self, name: &str, filename: &str, content_type: &str, bytes: impl Into<Vec<u8>>, ) -> Self
Add a file field from in-memory bytes.
Sourcepub fn file_path(
self,
name: &str,
path: &Path,
content_type: &str,
) -> Result<Self, HttpError>
pub fn file_path( self, name: &str, path: &Path, content_type: &str, ) -> Result<Self, HttpError>
Add a file field read from path. The file name becomes the part’s filename.
Sourcepub fn content_type(&self) -> String
pub fn content_type(&self) -> String
The Content-Type header value for this form.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Multipart
impl RefUnwindSafe for Multipart
impl Send for Multipart
impl Sync for Multipart
impl Unpin for Multipart
impl UnsafeUnpin for Multipart
impl UnwindSafe for Multipart
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