pub struct DnsServer { /* private fields */ }Expand description
Minimal UDP DNS server that answers A queries with fake IPs from a DnsMap.
Runs in a dedicated blocking thread (DNS is inherently synchronous and low-throughput enough that this is optimal).
Implementations§
Source§impl DnsServer
impl DnsServer
Sourcepub fn bind(addr: SocketAddr, map: DnsMap) -> Result<Self>
pub fn bind(addr: SocketAddr, map: DnsMap) -> Result<Self>
Bind to addr and create a server backed by map.
Sourcepub fn local_addr(&self) -> SocketAddr
pub fn local_addr(&self) -> SocketAddr
Return the local address the server is listening on.
Auto Trait Implementations§
impl Freeze for DnsServer
impl RefUnwindSafe for DnsServer
impl Send for DnsServer
impl Sync for DnsServer
impl Unpin for DnsServer
impl UnsafeUnpin for DnsServer
impl UnwindSafe for DnsServer
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more