Struct cocaine::Resolver
[−]
[src]
pub struct Resolver { /* fields omitted */ }
A Resolver
that uses the Locator
for name resolution.
It is cloneable, thread-safe and implements both Send
and Sync
traits, allowing to share
across multiple threads.
Examples
use cocaine::{Core, Resolve, Resolver, Service}; use cocaine::service::Locator; let mut core = Core::new().unwrap(); let resolver = Resolver::new(Locator::new(Service::new("locator", &core.handle()))); core.run(resolver.resolve("storage")).unwrap();
Methods
impl Resolver
[src]
fn new(locator: Locator) -> Self
[src]
Constructs a new Resolver
using the specified Locator
for name resolution.
Trait Implementations
impl Clone for Resolver
[src]
fn clone(&self) -> Resolver
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Debug for Resolver
[src]
impl Resolve for Resolver
[src]
type Future = Box<Future<Item = ResolveInfo<SocketAddr>, Error = Error>>
Future type that is returned during resolving.
fn resolve(&self, name: &str) -> Self::Future
[src]
Resolves a service name into the network endpoints.