Skip to main content

ExportSink

Trait ExportSink 

Source
pub(crate) trait ExportSink {
    // Required methods
    fn send_meta<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 mut self,
        file_name: &'life1 str,
        content_type: &'life2 str,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
    fn send_chunk<'life0, 'async_trait>(
        &'life0 mut self,
        data: Vec<u8>,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn send_summary<'life0, 'life1, 'async_trait>(
        &'life0 mut self,
        bytes_sent: usize,
        missing_channels: &'life1 [u8],
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn send_complete<'life0, 'async_trait>(
        &'life0 mut self,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn send_error<'life0, 'life1, 'async_trait>(
        &'life0 mut self,
        message: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

Transport abstraction for framed export responses.

Used by CsvStreamer in direct mode. Worker mode publishes to NATS directly through NatsCsvStreamer and publish_nats_json instead. Every method returns an error if the underlying transport fails to send.

Required Methods§

Source

fn send_meta<'life0, 'life1, 'life2, 'async_trait>( &'life0 mut self, file_name: &'life1 str, content_type: &'life2 str, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Sends the file metadata frame.

§Arguments
  • file_name - Suggested download file name.
  • content_type - MIME type of the payload.
Source

fn send_chunk<'life0, 'async_trait>( &'life0 mut self, data: Vec<u8>, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Sends one CSV payload chunk.

§Arguments
  • data - Raw CSV bytes.
Source

fn send_summary<'life0, 'life1, 'async_trait>( &'life0 mut self, bytes_sent: usize, missing_channels: &'life1 [u8], ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Sends the final export summary.

§Arguments
  • bytes_sent - Total CSV bytes sent in chunks, including the header line.
  • missing_channels - Requested channels that produced no rows.
Source

fn send_complete<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Sends the completion frame.

Source

fn send_error<'life0, 'life1, 'async_trait>( &'life0 mut self, message: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Sends an error frame.

§Arguments
  • message - Human-readable error text.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§