pub struct Part { /* private fields */ }Expand description
A single field for Form
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
plain-text field. field Content-Type is text/plain; charset=utf-8.
Sourcepub fn binary(name: impl Into<String>, body: impl Into<Bytes>) -> Self
pub fn binary(name: impl Into<String>, body: impl Into<Bytes>) -> Self
fixed binary field. field Content-Type is application/octet-stream.
Sourcepub fn stream<S>(name: impl Into<String>, stream: S) -> Self
pub fn stream<S>(name: impl Into<String>, stream: S) -> Self
streaming binary field. field Content-Type is application/octet-stream.
Stream trait is utilized for generic async streaming interface
Sourcepub fn file_name(self, filename: impl Into<String>) -> Self
pub fn file_name(self, filename: impl Into<String>) -> Self
Attach a filename (sets the filename parameter in Content-Disposition).
Sourcepub fn content_type(self, ct: impl Into<Cow<'static, str>>) -> Self
pub fn content_type(self, ct: impl Into<Cow<'static, str>>) -> Self
Override the Content-Type for this part.
Auto Trait Implementations§
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