pub struct Part<'a> { /* private fields */ }Available on crate feature
alloc only.Expand description
One part of a buffered multipart body. Its data borrows the body.
Implementations§
Source§impl<'a> Part<'a>
impl<'a> Part<'a>
Sourcepub fn name(&self) -> &str
pub fn name(&self) -> &str
The field name, HTML escapes (%0A, %0D, %22) decoded.
§Examples
assert_eq!(mp.parts()[0].name(), "a\"b");Sourcepub fn filename(&self) -> Option<FileName<'_>>
pub fn filename(&self) -> Option<FileName<'_>>
The client’s file name, for file parts.
§Examples
assert_eq!(mp.parts()[0].filename().unwrap().raw(), b"me.png");Sourcepub fn content_type(&self) -> Option<ContentType<'a>>
pub fn content_type(&self) -> Option<ContentType<'a>>
The declared Content-Type: a hint, never trusted.
§Examples
assert!(mp.parts()[0].content_type().unwrap().is("image", "png"));Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for Part<'a>
impl<'a> RefUnwindSafe for Part<'a>
impl<'a> Send for Part<'a>
impl<'a> Sync for Part<'a>
impl<'a> Unpin for Part<'a>
impl<'a> UnsafeUnpin for Part<'a>
impl<'a> UnwindSafe for Part<'a>
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