[][src]Struct mpart_async::client::MultipartRequest

pub struct MultipartRequest<S> { /* fields omitted */ }

The main MultipartRequest struct for sending Multipart submissions to servers

Implementations

impl<E, S> MultipartRequest<S> where
    S: Stream<Item = Result<Bytes, E>> + Unpin
[src]

pub fn new<I: Into<String>>(boundary: I) -> Self[src]

Construct a new MultipartRequest with a given Boundary

If you want a boundary generated automatically, then you can use MultipartRequest::default()

pub fn add_stream<I: Into<String>>(
    &mut self,
    name: I,
    filename: I,
    content_type: I,
    stream: S
)
[src]

Add a raw Stream to the Multipart request

The Stream should return items of Result<Bytes, Error>

pub fn add_field<I: Into<String>>(&mut self, name: I, value: I)[src]

Add a Field to the Multipart request

pub fn get_boundary(&self) -> &str[src]

Gets the boundary for the MultipartRequest

This is useful for supplying the Content-Type header

impl MultipartRequest<FileStream>[src]

pub fn add_file<I: Into<String>, P: Into<PathBuf>>(&mut self, name: I, path: P)[src]

Add a FileStream to a MultipartRequest given a path to a file

This will guess the Content Type based upon the path (i.e, .jpg will be image/jpeg)

Trait Implementations

impl<E, S> Default for MultipartRequest<S> where
    S: Stream<Item = Result<Bytes, E>> + Unpin
[src]

impl<E, S: Stream> Stream for MultipartRequest<S> where
    S: Stream<Item = Result<Bytes, E>> + Unpin
[src]

type Item = Result<Bytes, E>

Values yielded by the stream.

Auto Trait Implementations

impl<S> RefUnwindSafe for MultipartRequest<S> where
    S: RefUnwindSafe
[src]

impl<S> Send for MultipartRequest<S> where
    S: Send
[src]

impl<S> Sync for MultipartRequest<S> where
    S: Sync
[src]

impl<S> Unpin for MultipartRequest<S> where
    S: Unpin
[src]

impl<S> UnwindSafe for MultipartRequest<S> where
    S: 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<St> StreamExt for St where
    St: Stream + ?Sized
[src]

impl<T> StreamExt for T where
    T: Stream + ?Sized
[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<S, T, E> TryStream for S where
    S: Stream<Item = Result<T, E>> + ?Sized
[src]

type Ok = T

The type of successful values yielded by this future

type Error = E

The type of failures yielded by this future

impl<S> TryStreamExt for S where
    S: TryStream + ?Sized
[src]

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