Skip to main content

CsvStreamRequest

Trait CsvStreamRequest 

Source
pub trait CsvStreamRequest {
    // Required methods
    fn csv_stream_body<S, T>(
        self,
        stream: S,
        with_csv_header: bool,
        delimiter: u8,
    ) -> RequestBuilder
       where T: Serialize + Send + 'static,
             S: Stream<Item = T> + Send + 'static;
    fn try_csv_stream_body<S, T, E>(
        self,
        stream: S,
        with_csv_header: bool,
        delimiter: u8,
    ) -> RequestBuilder
       where T: Serialize + Send + 'static,
             S: Stream<Item = Result<T, E>> + Send + 'static,
             E: Into<Box<dyn Error + Send + Sync>> + Send + 'static;
}
Available on crate feature csv only.
Expand description

Extension trait for reqwest::RequestBuilder that streams a CSV request body.

See ReqwestStreamBody for the HTTP caveats that apply to every streamed request body.

Required Methods§

Source

fn csv_stream_body<S, T>( self, stream: S, with_csv_header: bool, delimiter: u8, ) -> RequestBuilder
where T: Serialize + Send + 'static, S: Stream<Item = T> + Send + 'static,

Streams stream as CSV, setting Content-Type: text/csv.

with_csv_header writes a header row from the field names before the first record.

Source

fn try_csv_stream_body<S, T, E>( self, stream: S, with_csv_header: bool, delimiter: u8, ) -> RequestBuilder
where T: Serialize + Send + 'static, S: Stream<Item = Result<T, E>> + Send + 'static, E: Into<Box<dyn Error + Send + Sync>> + Send + 'static,

Streams a fallible stream as CSV.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl CsvStreamRequest for RequestBuilder

Source§

fn csv_stream_body<S, T>( self, stream: S, with_csv_header: bool, delimiter: u8, ) -> RequestBuilder
where T: Serialize + Send + 'static, S: Stream<Item = T> + Send + 'static,

Source§

fn try_csv_stream_body<S, T, E>( self, stream: S, with_csv_header: bool, delimiter: u8, ) -> RequestBuilder
where T: Serialize + Send + 'static, S: Stream<Item = Result<T, E>> + Send + 'static, E: Into<Box<dyn Error + Send + Sync>> + Send + 'static,

Implementors§