pub struct Part { /* private fields */ }Expand description
One part of a multipart body.
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 part: --field name=value.
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 part: --file name=@path. filename is what the server sees.
pub fn name(&self) -> &str
pub fn filename(&self) -> Option<&str>
pub fn bytes(&self) -> &[u8] ⓘ
Trait Implementations§
impl Eq for Part
impl StructuralPartialEq for 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.