[][src]Struct multipart::client::SizedRequest

pub struct SizedRequest<R> { /* fields omitted */ }

A wrapper around a request object that measures the request body and sets the Content-Length header to its size in bytes.

Sized requests are more human-readable and use less bandwidth (as chunking adds visual noise and overhead), but they must be able to load their entirety, including the contents of all files and streams, into memory so the request body can be measured.

You should really only use sized requests if you intend to inspect the data manually on the server side, as it will produce a more human-readable request body. Also, of course, if the server doesn't support chunked requests or otherwise rejects them.

Trait Implementations

impl<R: HttpRequest> HttpRequest for SizedRequest<R> where
    <R::Stream as HttpStream>::Error: From<R::Error>, 
[src]

type Stream = Self

The HTTP stream type that can be opend by this request, to which the multipart data will be written. Read more

type Error = R::Error

The error type for this request. Must be compatible with io::Error as well as Self::HttpStream::Error Read more

pub fn apply_headers(
    &mut self,
    boundary: &str,
    _content_len: Option<u64>
) -> bool
[src]

SizedRequest ignores _content_len because it sets its own later.

impl<R: HttpRequest> HttpStream for SizedRequest<R> where
    <R::Stream as HttpStream>::Error: From<R::Error>, 
[src]

type Request = Self

The request type that opened this stream.

type Response = <<R as HttpRequest>::Stream as HttpStream>::Response

The response type that will be returned after the request is completed.

type Error = <<R as HttpRequest>::Stream as HttpStream>::Error

The error type for this stream. Must be compatible with io::Error as well as Self::Request::Error. Read more

impl<R> Write for SizedRequest<R>[src]

Auto Trait Implementations

impl<R> RefUnwindSafe for SizedRequest<R> where
    R: RefUnwindSafe
[src]

impl<R> Send for SizedRequest<R> where
    R: Send
[src]

impl<R> Sync for SizedRequest<R> where
    R: Sync
[src]

impl<R> Unpin for SizedRequest<R> where
    R: Unpin
[src]

impl<R> UnwindSafe for SizedRequest<R> where
    R: UnwindSafe
[src]

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Typeable for T where
    T: Any

impl<T> UnsafeAny for T where
    T: Any

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 

impl<W> WriteBytesExt for W where
    W: Write + ?Sized