Trait apisdk::DnsResolver

source ·
pub trait DnsResolver: 'static + Send + Sync {
    // Required method
    fn resolve<'life0, 'life1, 'async_trait>(
        &'life0 self,
        name: &'life1 str
    ) -> Pin<Box<dyn Future<Output = Option<SocketAddrs>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;

    // Provided methods
    fn get_scheme(&self) -> Option<&str> { ... }
    fn get_port(&self) -> Option<u16> { ... }
}
Expand description

This trait is used to performing DNS queries

Required Methods§

source

fn resolve<'life0, 'life1, 'async_trait>( &'life0 self, name: &'life1 str ) -> Pin<Box<dyn Future<Output = Option<SocketAddrs>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Do DNS queries

Provided Methods§

source

fn get_scheme(&self) -> Option<&str>

Return Some if scheme should be changed

source

fn get_port(&self) -> Option<u16>

Return Some if port should be changed

Trait Implementations§

source§

impl DnsResolver for Box<dyn DnsResolver>

source§

fn resolve<'life0, 'life1, 'async_trait>( &'life0 self, name: &'life1 str ) -> Pin<Box<dyn Future<Output = Option<SocketAddrs>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Do DNS queries
source§

fn get_scheme(&self) -> Option<&str>

Return Some if scheme should be changed
source§

fn get_port(&self) -> Option<u16>

Return Some if port should be changed

Implementations on Foreign Types§

source§

impl DnsResolver for IpAddr

source§

fn resolve<'life0, 'life1, 'async_trait>( &'life0 self, _name: &'life1 str ) -> Pin<Box<dyn Future<Output = Option<SocketAddrs>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

source§

impl DnsResolver for SocketAddr

source§

fn resolve<'life0, 'life1, 'async_trait>( &'life0 self, _name: &'life1 str ) -> Pin<Box<dyn Future<Output = Option<SocketAddrs>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

source§

impl DnsResolver for Box<dyn DnsResolver>

source§

fn resolve<'life0, 'life1, 'async_trait>( &'life0 self, name: &'life1 str ) -> Pin<Box<dyn Future<Output = Option<SocketAddrs>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

source§

impl<T> DnsResolver for (T, u16)
where T: Into<IpAddr> + 'static + Send + Sync + Clone,

source§

fn get_port(&self) -> Option<u16>

source§

fn resolve<'life0, 'life1, 'async_trait>( &'life0 self, _name: &'life1 str ) -> Pin<Box<dyn Future<Output = Option<SocketAddrs>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Implementors§

source§

impl<F> DnsResolver for F
where F: Fn(&str) -> Option<SocketAddrs> + 'static + Send + Sync,