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§
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.