Trait mz_environmentd::http::sql::ResultSender

source ·
trait ResultSender: Send {
    const SUPPORTS_STREAMING_NOTICES: bool = false;

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

    // Provided method
    fn emit_streaming_notices<'life0, 'async_trait>(
        &'life0 mut self,
        __arg1: Vec<AdapterNotice>
    ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
       where 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.

Provided Associated Constants§

Required Methods§

source

fn add_result<'life0, 'life1, 'async_trait>( &'life0 mut self, client: &'life1 mut SessionClient, res: StatementResult ) -> Pin<Box<dyn Future<Output = (Result<Result<(), ()>, Error>, Option<(StatementEndedExecutionReason, ExecuteContextExtra)>)> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: '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 emit_streaming_notices<'life0, 'async_trait>( &'life0 mut self, __arg1: Vec<AdapterNotice> ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Emits a streaming notice if the sender supports it.

Does nothing if SUPPORTS_STREAMING_NOTICES is false.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl ResultSender for WebSocket

source§

const SUPPORTS_STREAMING_NOTICES: bool = true

source§

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

source§

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

source§

fn allow_subscribe(&self) -> bool

source§

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

Implementors§