pub struct Part { /* private fields */ }Expand description
A generic multipart form part that can represent text or binary data
Implementations§
Source§impl Part
impl Part
Sourcepub fn bytes(name: impl Into<String>, data: impl Into<Bytes>) -> Part
pub fn bytes(name: impl Into<String>, data: impl Into<Bytes>) -> Part
Create a binary part (e.g., file upload)
Sourcepub fn content_type(self, content_type: Mime) -> Part
pub fn content_type(self, content_type: Mime) -> Part
Set the content type for this part
Sourcepub fn get_filename(&self) -> Option<&str>
pub fn get_filename(&self) -> Option<&str>
Get the filename if set
Sourcepub fn get_content_type(&self) -> Option<&Mime>
pub fn get_content_type(&self) -> Option<&Mime>
Get the content type if set
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§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)