Trait Resolve
trait Resolve: Send + Sync
Trait for customizing DNS resolution in reqwest.
Required Methods
fn resolve(self: &Self, name: Name) -> ResolvingPerforms DNS resolution on a
Name. The return type is a future containing an iterator ofSocketAddr.It differs from
tower_service::Service<Name>in several ways:- It is assumed that
resolvewill always be ready to poll. - It does not need a mutable reference to
self. - Since trait objects cannot make use of associated types, it requires
wrapping the returned
Futureand its containedIteratorwithBox.
Explicitly specified port in the URL will override any port in the resolved
SocketAddrs. Otherwise, port0will be replaced by the conventional port for the given scheme (e.g. 80 for http).- It is assumed that