pub struct DnsServer { /* private fields */ }Expand description
A DNS server that answers until it is dropped.
Implementations§
Source§impl DnsServer
impl DnsServer
Sourcepub async fn start(records: &[(&str, &str)]) -> Result<Self>
pub async fn start(records: &[(&str, &str)]) -> Result<Self>
Serves records, pairs of a name and an address, on a free UDP port
of the loopback interface. Names are compared ignoring case.
§Errors
The errors of binding the port, and io::ErrorKind::InvalidInput
for an address that is not one.
Sourcepub fn address(&self) -> SocketAddr
pub fn address(&self) -> SocketAddr
The address to send queries to.
Trait Implementations§
Auto Trait Implementations§
impl Forget for DnsServer
impl Freeze for DnsServer
impl Move 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