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§
const SUPPORTS_STREAMING_NOTICES: bool = false
Required Methods§
Sourcefn 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 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.
Sourcefn connection_error(&mut self) -> BoxFuture<'_, Error>
fn connection_error(&mut self) -> BoxFuture<'_, Error>
Returns a future that resolves only when the client connection has gone away.
Sourcefn allow_subscribe(&self) -> bool
fn allow_subscribe(&self) -> bool
Reports whether the client supports streaming SUBSCRIBE results.
Provided Methods§
Sourcefn 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,
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.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.