pub trait ApplicationHandler:
Send
+ Sync
+ 'static {
// Required methods
fn protocol(&self) -> &'static str;
fn capabilities(&self) -> Vec<String>;
fn initialize<'life0, 'life1, 'async_trait>(
&'life0 self,
context: &'life1 RequestContext,
application: Value,
) -> Pin<Box<dyn Future<Output = RpcResult<Value>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn call<'life0, 'life1, 'async_trait>(
&'life0 self,
context: RequestContext,
method: &'life1 str,
params: Value,
) -> Pin<Box<dyn Future<Output = RpcResult<Value>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
// Provided methods
fn versions(&self) -> &'static [u32] { ... }
fn validate_capabilities(&self, _capabilities: &[String]) -> RpcResult<()> { ... }
fn request_finished<'life0, 'async_trait>(
&'life0 self,
_request_id: RequestId,
_committed: bool,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait { ... }
fn shutdown<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait { ... }
}Expand description
Transport-independent application hook. Typed resolution and provider adapters below this layer own application parameter validation.
Required Methods§
fn protocol(&self) -> &'static str
fn capabilities(&self) -> Vec<String>
fn initialize<'life0, 'life1, 'async_trait>(
&'life0 self,
context: &'life1 RequestContext,
application: Value,
) -> Pin<Box<dyn Future<Output = RpcResult<Value>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn call<'life0, 'life1, 'async_trait>(
&'life0 self,
context: RequestContext,
method: &'life1 str,
params: Value,
) -> Pin<Box<dyn Future<Output = RpcResult<Value>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Provided Methods§
fn versions(&self) -> &'static [u32]
fn validate_capabilities(&self, _capabilities: &[String]) -> RpcResult<()>
Sourcefn request_finished<'life0, 'async_trait>(
&'life0 self,
_request_id: RequestId,
_committed: bool,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn request_finished<'life0, 'async_trait>(
&'life0 self,
_request_id: RequestId,
_committed: bool,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Reports whether the application’s response became the terminal writer outcome. Handlers use an uncommitted outcome to release resources that were created while producing a response (for example resolver leases).
fn shutdown<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".