Struct multipart::client::lazy::Multipart [] [src]

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.

Lifetimes

  • '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>.

Methods

impl<'n, 'd> Multipart<'n, 'd>
[src]

Feature: hyper

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).

Feature: hyper

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.

impl<'n, 'd> Multipart<'n, 'd>
[src]

Initialize a new lazy dynamic request.

Add a text field to this request.

Add a file field to this request.

Note

Does not check if path exists.

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.

Export the multipart data contained in this lazy request as an adaptor which implements Read.

A certain amount of field data will be buffered. See prepare_threshold() for more information on this behavior.

Export the multipart data contained in this lazy request to an adaptor which implements Read.

Buffering

For efficiency, text and file fields smaller than buffer_threshold are copied to an in-memory buffer. If None, all fields are copied to memory.

Trait Implementations

impl<'n, 'd> Debug for Multipart<'n, 'd>
[src]

Formats the value using the given formatter.

impl<'n, 'd> Default for Multipart<'n, 'd>
[src]

Returns the "default value" for a type. Read more