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]
impl Resolver
pub fn new(locator: Locator) -> Self
[src]
pub fn new(locator: Locator) -> Self
Constructs a new Resolver
using the specified Locator
for name resolution.
Trait Implementations
impl Clone for Resolver
[src]
impl Clone for Resolver
fn clone(&self) -> Resolver
[src]
fn clone(&self) -> Resolver
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
1.0.0
[src]Performs copy-assignment from source
. Read more
impl Debug for Resolver
[src]
impl Debug for Resolver
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl Resolve for Resolver
[src]
impl Resolve for Resolver
type Future = Box<Future<Item = ResolveInfo<SocketAddr>, Error = Error>>
Future type that is returned during resolving.
fn resolve(&self, name: &str) -> Self::Future
[src]
fn resolve(&self, name: &str) -> Self::Future
Resolves a service name into the network endpoints.