[−][src]Struct multipart::client::lazy::Multipart
A multipart request which writes all fields at once upon being provided an output stream.
Sacrifices static dispatch for support for dynamic construction. Reusable.
Lifetimes
'n
: Lifetime for field names; will only escape this struct inLazyIoError<'n>
.'d
: Lifetime for data: will only escape this struct inPreparedFields<'d>
.
Implementations
impl<'n, 'd> Multipart<'n, 'd>
[src]
pub fn new() -> Self
[src]
Initialize a new lazy dynamic request.
pub fn add_text<N, T>(&mut self, name: N, text: T) -> &mut Self where
N: Into<Cow<'n, str>>,
T: Into<Cow<'d, str>>,
[src]
N: Into<Cow<'n, str>>,
T: Into<Cow<'d, str>>,
Add a text field to this request.
pub fn add_file<N, P>(&mut self, name: N, path: P) -> &mut Self where
N: Into<Cow<'n, str>>,
P: IntoCowPath<'d>,
[src]
N: Into<Cow<'n, str>>,
P: IntoCowPath<'d>,
pub fn add_stream<N, R, F>(
&mut self,
name: N,
stream: R,
filename: Option<F>,
mime: Option<Mime>
) -> &mut Self where
N: Into<Cow<'n, str>>,
R: Read + 'd,
F: Into<Cow<'n, str>>,
[src]
&mut self,
name: N,
stream: R,
filename: Option<F>,
mime: Option<Mime>
) -> &mut Self where
N: Into<Cow<'n, str>>,
R: Read + 'd,
F: Into<Cow<'n, str>>,
Add a generic stream field to this request,
pub fn send<R: HttpRequest>(
&mut self,
req: R
) -> Result<<R::Stream as HttpStream>::Response, LazyError<'n, <R::Stream as HttpStream>::Error>>
[src]
&mut self,
req: R
) -> Result<<R::Stream as HttpStream>::Response, LazyError<'n, <R::Stream as HttpStream>::Error>>
Convert req
to HttpStream
, write out the fields in this request, and finish the
request, returning the response if successful, or the first error encountered.
If any files were added by path they will now be opened for reading.
pub fn prepare(&mut self) -> LazyIoResult<'n, PreparedFields<'d>>
[src]
Export the multipart data contained in this lazy request as an adaptor which implements Read
.
During this step, if any files were added by path then they will be opened for reading and their length measured.
Trait Implementations
Auto Trait Implementations
impl<'n, 'd> !RefUnwindSafe for Multipart<'n, 'd>
[src]
impl<'n, 'd> !Send for Multipart<'n, 'd>
[src]
impl<'n, 'd> !Sync for Multipart<'n, 'd>
[src]
impl<'n, 'd> Unpin for Multipart<'n, 'd>
[src]
impl<'n, 'd> !UnwindSafe for Multipart<'n, 'd>
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
[src]
V: MultiLane<T>,