1
2
3
4
5
6
7
8
9
10
11
12
use futures::Stream;

use tonic::Status;

/// Tries to get rows.
#[tonic::async_trait]
pub trait DataSource: Sync + Send + 'static {
    type Row;
    type Rows: Stream<Item = Result<Self::Row, Status>>;

    async fn get_rows(&self) -> Result<Self::Rows, Status>;
}