EncHandler

Trait EncHandler 

Source
pub trait EncHandler: Send + Sync {
    // Required method
    fn handle<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        client: Arc<Client>,
        enc_node: &'life1 Node,
        info: &'life2 MessageInfo,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
}
Expand description

Trait for handling custom encrypted message types

Required Methods§

Source

fn handle<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, client: Arc<Client>, enc_node: &'life1 Node, info: &'life2 MessageInfo, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Handle an encrypted node of a specific type

§Arguments
  • client - The client instance
  • enc_node - The encrypted node to handle
  • info - The message info context
§Returns
  • Ok(()) if the message was handled successfully
  • Err(anyhow::Error) if handling failed

Implementors§