Struct mpart_async::client::MultipartRequest
source · [−]pub struct MultipartRequest<S> { /* private fields */ }
Expand description
The main MultipartRequest
struct for sending Multipart submissions to servers
Implementations
sourceimpl<E, S> MultipartRequest<S> where
S: Stream<Item = Result<Bytes, E>> + Unpin,
impl<E, S> MultipartRequest<S> where
S: Stream<Item = Result<Bytes, E>> + Unpin,
sourcepub fn new<I: Into<String>>(boundary: I) -> Self
pub fn new<I: Into<String>>(boundary: I) -> Self
Construct a new MultipartRequest with a given Boundary
If you want a boundary generated automatically, then you can use MultipartRequest::default()
sourcepub fn add_stream<I: Into<String>>(
&mut self,
name: I,
filename: I,
content_type: I,
stream: S
)
pub fn add_stream<I: Into<String>>(
&mut self,
name: I,
filename: I,
content_type: I,
stream: S
)
Add a raw Stream to the Multipart request
The Stream should return items of Result<Bytes, Error>
sourcepub fn add_field<I: Into<String>>(&mut self, name: I, value: I)
pub fn add_field<I: Into<String>>(&mut self, name: I, value: I)
Add a Field to the Multipart request
sourcepub fn get_boundary(&self) -> &str
pub fn get_boundary(&self) -> &str
Gets the boundary for the MultipartRequest
This is useful for supplying the Content-Type
header
Trait Implementations
sourceimpl<E, S: Stream> Stream for MultipartRequest<S> where
S: Stream<Item = Result<Bytes, E>> + Unpin,
impl<E, S: Stream> Stream for MultipartRequest<S> where
S: Stream<Item = Result<Bytes, E>> + Unpin,
Auto Trait Implementations
impl<S> RefUnwindSafe for MultipartRequest<S> where
S: RefUnwindSafe,
impl<S> Send for MultipartRequest<S> where
S: Send,
impl<S> Sync for MultipartRequest<S> where
S: Sync,
impl<S> Unpin for MultipartRequest<S> where
S: Unpin,
impl<S> UnwindSafe for MultipartRequest<S> where
S: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more