pub trait RpcContext {
const LQ_SUPPORT: bool = false;
// Required methods
fn kvs(&self) -> &Datastore;
fn lock(&self) -> Arc<Semaphore>;
fn session(&self) -> Arc<Session>;
fn set_session(&self, session: Arc<Session>);
fn version_data(&self) -> Data;
// Provided methods
fn handle_live(&self, _lqid: &Uuid) -> impl Future<Output = ()> + Send { ... }
fn handle_kill(&self, _lqid: &Uuid) -> impl Future<Output = ()> + Send { ... }
fn cleanup_lqs(&self) -> impl Future<Output = ()> + Send { ... }
async fn execute(
&self,
version: Option<u8>,
method: Method,
params: Array,
) -> Result<Data, RpcError>
where Self: RpcProtocolV1 + RpcProtocolV2 { ... }
}
Provided Associated Constants§
Sourceconst LQ_SUPPORT: bool = false
const LQ_SUPPORT: bool = false
Live queries are disabled by default
Required Methods§
Sourcefn set_session(&self, session: Arc<Session>)
fn set_session(&self, session: Arc<Session>)
Mutable access to the current session for this RPC context
Sourcefn version_data(&self) -> Data
fn version_data(&self) -> Data
The version information for this RPC context
Provided Methods§
Sourcefn handle_live(&self, _lqid: &Uuid) -> impl Future<Output = ()> + Send
fn handle_live(&self, _lqid: &Uuid) -> impl Future<Output = ()> + Send
Handles the execution of a LIVE statement
Sourcefn handle_kill(&self, _lqid: &Uuid) -> impl Future<Output = ()> + Send
fn handle_kill(&self, _lqid: &Uuid) -> impl Future<Output = ()> + Send
Handles the execution of a KILL statement
Sourcefn cleanup_lqs(&self) -> impl Future<Output = ()> + Send
fn cleanup_lqs(&self) -> impl Future<Output = ()> + Send
Handles the cleanup of live queries
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.