Crate abstract_ns [−] [src]
Abstract traits for name service library
Here are small breakdown:
Name
is currently an alias to&str
(but it may change in future)Address
is a structure which address resolves to. It's more than just aSocketAddr
you have used to, but there isAddress::pick_one()
which does quick and dirty solutionResolver
is a structure which is a configured resolver. You may use many different resolvers in your application. UseResolver::resolve(name)
to get a futureResolver::subscribe(name)
to get a stream of updates.MemResolver
is an in-memory hash table for addresses you may use for testsRouter
is a way to specify different sources for different names, for example serve*.consul
from local consul, other things from conventional DNS servers
Structs
Address |
Address that nameservice has returned |
AddressBuilder |
A builder interface for |
MemResolver |
A stub resolver that resolves names from in-memory hash table |
Router |
A helper which allows to resolve different names by different means |
RouterBuilder |
A builder/fluent interface to create a |
Union |
Represents a stream that is the result of |
WeightedSet |
A structure that represents a set of addresses of the same priority |
Enums
Error |
A generic name resolution error |
Traits
Resolver |
Main trait that does name resolution |
Functions
union_addresses |
Union |
union_stream |
Get the stream that emits address that is a union (superset) of all adderesses of underlying streams |
Type Definitions
Name |
A type alias that represents a name resolved by a name service |
Weight |
A type alias for a weight for each name in an address |