Skip to main content

ResolveAddr

Trait ResolveAddr 

Source
pub trait ResolveAddr:
    Debug
    + Send
    + Sync {
    // Required method
    fn resolve<RT: AsyncRuntime>(
        &self,
    ) -> impl Future<Output = Result<UnifyAddr, AddrParseError>> + Send;
}
Expand description

Resolve addr in async to one address for listen or connect

§NOTE:

When we can’t directly resolve the IP, try to resolve it through the domain name with background spawn thread, will not block current thread.

If multiple IP addresses are resolved, only the first result is taken

Required Methods§

Source

fn resolve<RT: AsyncRuntime>( &self, ) -> impl Future<Output = Result<UnifyAddr, AddrParseError>> + Send

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl ResolveAddr for &str

Source§

impl ResolveAddr for str

Source§

impl ResolveAddr for String

Implementors§