pub struct DnsResolver { /* private fields */ }Expand description
Background DNS resolver with caching
Implementations§
Source§impl DnsResolver
impl DnsResolver
Sourcepub fn new(config: DnsResolverConfig) -> Self
pub fn new(config: DnsResolverConfig) -> Self
Create a new DNS resolver with the given configuration
Sourcepub fn with_defaults() -> Self
pub fn with_defaults() -> Self
Create a new DNS resolver with default configuration
Sourcepub fn request_resolution(&self, ip: IpAddr)
pub fn request_resolution(&self, ip: IpAddr)
Request resolution for an IP address (non-blocking)
Sourcepub fn get_hostname(&self, ip: &IpAddr) -> Option<String>
pub fn get_hostname(&self, ip: &IpAddr) -> Option<String>
Get hostname for IP if resolved, otherwise return None
Trait Implementations§
Source§impl Drop for DnsResolver
impl Drop for DnsResolver
Auto Trait Implementations§
impl !RefUnwindSafe for DnsResolver
impl !UnwindSafe for DnsResolver
impl Freeze for DnsResolver
impl Send for DnsResolver
impl Sync for DnsResolver
impl Unpin for DnsResolver
impl UnsafeUnpin for DnsResolver
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