pub struct Part { /* private fields */ }Expand description
One form field: a text value or a named file.
Implementations§
Source§impl Part
impl Part
Sourcepub fn text(name: impl Into<String>, value: impl Into<String>) -> Self
pub fn text(name: impl Into<String>, value: impl Into<String>) -> Self
A text field. No Content-Type is written unless one is set.
Sourcepub fn file(
name: impl Into<String>,
filename: impl Into<String>,
bytes: Vec<u8>,
) -> Self
pub fn file( name: impl Into<String>, filename: impl Into<String>, bytes: Vec<u8>, ) -> Self
A file field. Its Content-Type is application/octet-stream unless set.
pub fn content_type(self, content_type: impl Into<String>) -> Self
Trait Implementations§
impl Eq for Part
impl StructuralPartialEq for Part
Auto Trait Implementations§
impl Forget for Part
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