Skip to main content

ApplicationHandler

Trait ApplicationHandler 

Source
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§

Source

fn protocol(&self) -> &'static str

Source

fn capabilities(&self) -> Vec<String>

Source

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,

Source

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§

Source

fn versions(&self) -> &'static [u32]

Source

fn validate_capabilities(&self, _capabilities: &[String]) -> RpcResult<()>

Source

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).

Source

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".

Implementors§