pub struct MultipartRequest<S> { /* private fields */ }
Expand description
The main MultipartRequest
struct for sending Multipart submissions to servers
Implementations§
Source§impl<E, S> MultipartRequest<S>
impl<E, S> MultipartRequest<S>
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§
Source§impl<E, S> Default for MultipartRequest<S>
impl<E, S> Default for MultipartRequest<S>
Source§impl<E, S> Stream for MultipartRequest<S>
impl<E, S> Stream for MultipartRequest<S>
Auto Trait Implementations§
impl<S> Freeze for MultipartRequest<S>where
S: Freeze,
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§
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