Struct abstract_ns::RouterBuilder
[−]
[src]
pub struct RouterBuilder(_);
A builder/fluent interface to create a Router
Methods
impl RouterBuilder
[src]
fn new() -> RouterBuilder
Start creating DNS router object
fn add_ip(&mut self, name: Name, ip: IpAddr) -> &mut Self
Add a name that is resolved to a single IP (just like in MemResolver
)
fn add_suffix<S, R>(&mut self, suffix: S, resolver: R) -> &mut Self where S: Into<String>, R: Resolver + 'static
Add a suffix which will be resolved using specified resolver object
This is useful for example to resolve all *.consul
addresses against
consul.
Suffixes are always matched after dot in the name. Suffixes passed to to this function must not contain initial dot.
If overlapping suffixes are specified, longest matching suffix wins.
fn add_default<R>(&mut self, resolver: R) -> &mut Self where R: Resolver + 'static
Add a default resolver
Default resolver works as fallback when neither specific names nor suffixes matches.
Note: when suffix matches but returns non existent domain name the default resolver is not called.
fn into_resolver(self) -> Router
Build real router object which can be used to resolve names