pub struct Multipart<'n, 'd> { /* fields omitted */ }
A multipart request which writes all fields at once upon being provided an output stream.
Sacrifices static dispatch for support for dynamic construction. Reusable.
'n
: Lifetime for field names; will only escape this struct in LazyIoError<'n>
.
'd
: Lifetime for data: will only escape this struct in PreparedFields<'d>
.
Complete a POST request with the given hyper::client::Client
and URL.
Supplies the fields in the body, optionally setting the content-length header if
applicable (all added fields were text or files, i.e. no streams).
Complete a POST request with the given hyper::client::Client
and URL;
allows mutating the hyper::client::RequestBuilder
via the passed closure.
Note that the body, and the ContentType
and ContentLength
headers will be
overwritten, either by this method or by Hyper.
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] |
Add a text field to this request.
Add a file field to this request.
Does not check if path
exists.
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] |
Add a generic stream field to this request,
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.
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.
Returns the "default value" for a type. Read more
Formats the value using the given formatter. Read more
🔬 This is a nightly-only experimental API. (try_from
)
The type returned in the event of a conversion error.
🔬 This is a nightly-only experimental API. (try_from
)
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more
🔬 This is a nightly-only experimental API. (try_from
)
The type returned in the event of a conversion error.
🔬 This is a nightly-only experimental API. (try_from
)
🔬 This is a nightly-only experimental API. (get_type_id
)
this method will likely be replaced by an associated static
impl<T> Typeable for T where T: Any, | |
Get the TypeId
of this object.
impl<T> DebugAny for T where T: Any + Debug, | |
impl<T> UnsafeAny for T where T: Any, | |