Struct salvo_core::http::multipart::FieldData[][src]

pub struct FieldData<'a, S: TryStream + 'a> where
    S::Error: Into<ReadError>, 
{ /* fields omitted */ }

The data of a field in a multipart stream, as a stream of chunks.

It may be read to completion via the Stream impl, or collected to a string with .read_to_string().

Implementations

impl<S: TryStream> FieldData<'_, S> where
    S::Ok: BodyChunk,
    S::Error: Into<ReadError>, 
[src]

pub fn read_to_string(self) -> ReadToString<Self>

Notable traits for ReadToString<S>

impl<S: TryStream + Unpin> Future for ReadToString<S> where
    S::Ok: BodyChunk,
    S::Error: Into<ReadError>, 
type Output = Result<String, ReadError>;
[src]

Return a Future which yields the result of reading this field’s data to a String.

Note: UTF-8 Only

Reading to a string using a non-UTF-8 charset is currently outside of the scope of this crate. Most browsers send form requests using the same charset as the page the form resides in, so as long as you only serve UTF-8 encoded pages, this would only realistically happen in one of two cases:

  • a non-browser client like cURL was specifically instructed by the user to use a non-UTF-8 charset, or:
  • the field is actually a text file encoded in a charset that is not UTF-8 (most likely Windows-1252 or UTF-16).

Trait Implementations

impl<S: TryStream> Stream for FieldData<'_, S> where
    S::Ok: BodyChunk,
    S::Error: Into<ReadError>, 
[src]

type Item = Result<S::Ok, ReadError>

Values yielded by the stream.

Auto Trait Implementations

impl<'a, S> RefUnwindSafe for FieldData<'a, S> where
    S: RefUnwindSafe,
    <S as TryStream>::Ok: RefUnwindSafe

impl<'a, S> Send for FieldData<'a, S> where
    S: Send,
    <S as TryStream>::Ok: Send

impl<'a, S> Sync for FieldData<'a, S> where
    S: Sync,
    <S as TryStream>::Ok: Sync

impl<'a, S> Unpin for FieldData<'a, S>

impl<'a, S> !UnwindSafe for FieldData<'a, S>

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> Instrument for T[src]

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

impl<T> Same<T> for T

type Output = T

Should always be Self

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

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>,