Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /home/zhenxiangba/zhenxiangba.com/public_html/phproxy-improved-master/index.php on line 456
StreamProvider in datafusion::datasource::stream - Rust
[go: Go Back, main page]

Trait StreamProvider

Source
pub trait StreamProvider:
    Debug
    + Send
    + Sync {
    // Required methods
    fn schema(&self) -> &SchemaRef;
    fn reader(&self) -> Result<Box<dyn RecordBatchReader>>;
    fn stream_write_display(
        &self,
        t: DisplayFormatType,
        f: &mut Formatter<'_>,
    ) -> Result;

    // Provided method
    fn writer(&self) -> Result<Box<dyn RecordBatchWriter>> { ... }
}
Expand description

The StreamProvider trait is used as a generic interface for reading and writing from streaming data sources (such as FIFO, Websocket, Kafka, etc.). Implementations of the provider are responsible for providing a RecordBatchReader and optionally a RecordBatchWriter.

Required Methods§

Source

fn schema(&self) -> &SchemaRef

Get a reference to the schema for this stream

Source

fn reader(&self) -> Result<Box<dyn RecordBatchReader>>

Provide RecordBatchReader

Source

fn stream_write_display( &self, t: DisplayFormatType, f: &mut Formatter<'_>, ) -> Result

Display implementation when using as a DataSink

Provided Methods§

Source

fn writer(&self) -> Result<Box<dyn RecordBatchWriter>>

Provide RecordBatchWriter

Implementors§