CustomHandler

Trait CustomHandler 

Source
pub trait CustomHandler:
    DynClone
    + Send
    + Sync {
    // Required method
    fn lookup<'life0, 'life1, 'async_trait>(
        &'life0 mut self,
        query: &'life1 Vec<u8>,
        socket: DnsSocket,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<u8>, CustomHandlerError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description
  • Trait to implement to make AnyDns use a custom handler.
  • Important: Handler must be clonable so it can be used by multiple threads.

Required Methods§

Source

fn lookup<'life0, 'life1, 'async_trait>( &'life0 mut self, query: &'life1 Vec<u8>, socket: DnsSocket, ) -> Pin<Box<dyn Future<Output = Result<Vec<u8>, CustomHandlerError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Implementors§