Skip to main content

MessageProcessor

Trait MessageProcessor 

Source
pub trait MessageProcessor: Send + Sync {
    // Required method
    fn process_message<'life0, 'async_trait>(
        &'life0 self,
        message: Message,
    ) -> Pin<Box<dyn Future<Output = Option<Response>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;

    // Provided methods
    fn process_batch<'life0, 'async_trait>(
        &'life0 self,
        messages: Vec<Message>,
    ) -> Pin<Box<dyn Future<Output = Vec<Response>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait { ... }
    fn supports_batching(&self) -> bool { ... }
    fn get_capabilities(&self) -> ProcessorCapabilities { ... }
}
Expand description

Trait for processing JSON-RPC messages

Required Methods§

Source

fn process_message<'life0, 'async_trait>( &'life0 self, message: Message, ) -> Pin<Box<dyn Future<Output = Option<Response>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Process a single JSON-RPC message

Provided Methods§

Source

fn process_batch<'life0, 'async_trait>( &'life0 self, messages: Vec<Message>, ) -> Pin<Box<dyn Future<Output = Vec<Response>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Process a batch of JSON-RPC messages

Source

fn supports_batching(&self) -> bool

Check if batch processing is supported

Source

fn get_capabilities(&self) -> ProcessorCapabilities

Get processor capabilities

Implementors§