pub trait AddressResolver:
Send
+ Sync
+ 'static {
type Address: Address;
type ResolvedAddress: CheapClone + Hash + Eq + Ord + Debug + Display + Send + Sync + 'static;
type Error: Error + Send + Sync + 'static;
type Runtime: RuntimeLite;
type Options: Send + Sync + 'static;
// Required methods
fn new(
options: Self::Options,
) -> impl Future<Output = Result<Self, Self::Error>> + Send
where Self: Sized;
fn resolve(
&self,
address: &Self::Address,
) -> impl Future<Output = Result<Self::ResolvedAddress, Self::Error>> + Send;
}Available on crate features
agnostic and resolver only.Expand description
Used to resolve a [SocketAddr] from a node address in async style.
Required Associated Types§
Sourcetype ResolvedAddress: CheapClone + Hash + Eq + Ord + Debug + Display + Send + Sync + 'static
type ResolvedAddress: CheapClone + Hash + Eq + Ord + Debug + Display + Send + Sync + 'static
The address type returned by the resolver.
Sourcetype Runtime: RuntimeLite
type Runtime: RuntimeLite
The runtime used to resolve the address.
Required Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementors§
Source§impl<R: Runtime> AddressResolver for DnsResolver<R>
Available on crate feature dns only.
impl<R: Runtime> AddressResolver for DnsResolver<R>
Available on crate feature
dns only.Source§impl<R: RuntimeLite> AddressResolver for HostAddrResolver<R>
Available on crate features async and std only.
impl<R: RuntimeLite> AddressResolver for HostAddrResolver<R>
Available on crate features
async and std only.Source§impl<R: RuntimeLite> AddressResolver for SocketAddrResolver<R>
Available on crate features async and std only.
impl<R: RuntimeLite> AddressResolver for SocketAddrResolver<R>
Available on crate features
async and std only.