Struct abstract_ns::MemResolver
[−]
[src]
pub struct MemResolver { /* fields omitted */ }
A stub resolver that resolves names from in-memory hash table
While this resolver is mostly useful in tests, you can also use it inside a chain of resolvers to resolve localhost or other built-in names.
Methods
impl MemResolver
[src]
fn new() -> MemResolver
Create new empty stub resolver
You should add some hosts to make it useful
fn add_host<S>(&mut self, name: S, address: IpAddr) where
S: Into<String>,
S: Into<String>,
Add a single host to resolve
Note: only name without port number should be specified as name
fn contains_name(&self, name: &str) -> bool
Check if name is in resolver