trait ResultSender: Send {
    // Required methods
    fn add_result<'life0, 'async_trait>(
        &'life0 mut self,
        res: StatementResult
    ) -> Pin<Box<dyn Future<Output = (Result<Result<(), ()>, Error>, Option<(StatementEndedExecutionReason, ExecuteContextExtra)>)> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn connection_error(&mut self) -> BoxFuture<'_, Error>;
    fn allow_subscribe(&self) -> bool;

    // Provided method
    fn await_rows<'life0, 'async_trait, F, R>(
        &'life0 mut self,
        f: F
    ) -> Pin<Box<dyn Future<Output = Result<R, Error>> + Send + 'async_trait>>
       where F: Future<Output = R> + Send + 'async_trait,
             R: 'async_trait,
             Self: 'async_trait,
             'life0: 'async_trait { ... }
}
Expand description

Trait describing how to transmit a response to a client. HTTP clients accumulate into a Vec and send all at once. WebSocket clients send each message as they occur.

Required Methods§

source

fn add_result<'life0, 'async_trait>( &'life0 mut self, res: StatementResult ) -> Pin<Box<dyn Future<Output = (Result<Result<(), ()>, Error>, Option<(StatementEndedExecutionReason, ExecuteContextExtra)>)> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Adds a result to the client. The first component of the return value is Err if sending to the client produced an error and the server should disconnect. It is Ok(Err) if the statement produced an error and should error the transaction, but remain connected. It is Ok(Ok(())) if the statement succeeded. The second component of the return value is Some if execution still needs to be retired for statement logging purposes.

source

fn connection_error(&mut self) -> BoxFuture<'_, Error>

Returns a future that resolves only when the client connection has gone away.

source

fn allow_subscribe(&self) -> bool

Reports whether the client supports streaming SUBSCRIBE results.

Provided Methods§

source

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

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl ResultSender for WebSocket

source§

fn add_result<'life0, 'async_trait>( &'life0 mut self, res: StatementResult ) -> Pin<Box<dyn Future<Output = (Result<Result<(), ()>, Error>, Option<(StatementEndedExecutionReason, ExecuteContextExtra)>)> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

source§

fn connection_error(&mut self) -> BoxFuture<'_, Error>

source§

fn allow_subscribe(&self) -> bool

Implementors§