Trait mz_environmentd::http::sql::ResultSender
source · trait ResultSender {
fn add_result<'life0, 'async_trait>(
&'life0 mut self,
res: StatementResult
) -> Pin<Box<dyn Future<Output = Result<Result<(), ()>, Error>> + Send + 'async_trait>>
where
Self: 'async_trait,
'life0: 'async_trait;
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;
fn allow_subscribe(&self) -> bool;
}
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§
sourcefn add_result<'life0, 'async_trait>(
&'life0 mut self,
res: StatementResult
) -> Pin<Box<dyn Future<Output = Result<Result<(), ()>, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn add_result<'life0, 'async_trait>(
&'life0 mut self,
res: StatementResult
) -> Pin<Box<dyn Future<Output = Result<Result<(), ()>, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Adds a result to the client. Returns Err if sending to the client produced an error and the server should disconnect. Returns Ok(Err) if the statement produced an error and should error the transaction, but remain connected. Returns Ok(Ok(())) if the statement succeeded.
sourcefn 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,
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,
Awaits a future while also able to check the status of the client connection. Should return an error if the client connection has gone away.
sourcefn allow_subscribe(&self) -> bool
fn allow_subscribe(&self) -> bool
Reports whether the client supports streaming SUBSCRIBE results.