pub struct Part { /* private fields */ }
Available on crate feature
multipart
only.Expand description
A field in a multipart form.
Implementations§
Source§impl Part
impl Part
Sourcepub fn body_with_length<T: Into<Body>>(value: T, length: u64) -> Part
pub fn body_with_length<T: Into<Body>>(value: T, length: u64) -> Part
Makes a new parameter from an arbitrary stream with a known length. This is particularly useful when adding something like file contents as a stream, where you can know the content length beforehand.
Sourcepub fn mime_str(self, mime: &str) -> Result<Part, BuildMultipartError>
pub fn mime_str(self, mime: &str) -> Result<Part, BuildMultipartError>
Tries to set the mime of this part.
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 !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