pub trait Resolve {
type Future: Future<Item = Address, Error = Error>;
// Required method
fn resolve(&self, name: &Name) -> Self::Future;
// Provided methods
fn frozen_subscriber(self) -> FrozenSubscriber<Self>
where Self: Resolve + Sized { ... }
fn frozen_service_subscriber(self) -> FrozenSubscriber<Self>
where Self: Sized { ... }
fn null_host_resolver(self) -> NullHostResolver<Self>
where Self: Sized { ... }
}
Expand description
Resolves a name of the service in to a set of addresses
This is commonly done using SRV records, but can also be done
as a wrapper around resolver by resolving a host and adding a
default value (see HostResolve::with_default_port
.
Required Associated Types§
Required Methods§
Provided Methods§
Sourcefn frozen_subscriber(self) -> FrozenSubscriber<Self>
fn frozen_subscriber(self) -> FrozenSubscriber<Self>
Create a subscriber that resolves once using this resolver and never updates a stream
This is mostly useful for tests
Sourcefn frozen_service_subscriber(self) -> FrozenSubscriber<Self>where
Self: Sized,
fn frozen_service_subscriber(self) -> FrozenSubscriber<Self>where
Self: Sized,
Create a subscriber that resolves once using this resolver and never updates a stream
This is mostly useful for tests
Sourcefn null_host_resolver(self) -> NullHostResolver<Self>where
Self: Sized,
fn null_host_resolver(self) -> NullHostResolver<Self>where
Self: Sized,
Create a thing that implements Resolve+HostResolve but returns
NameNotFound
on resolve_host
This is needed to add resolver that can only resolve services to the router.