pub struct Resolver {}Expand description
Cross-platform DNS resolver backed by the platform’s system resolver.
Implementations§
Source§impl Resolver
impl Resolver
Sourcepub fn supports_txt() -> bool
pub fn supports_txt() -> bool
Whether this platform can resolve TXT records. False on Android below API 29.
Sourcepub async fn txt_lookup<S: AsRef<str>>(
host: S,
) -> Result<Vec<String>, ResolverError>
pub async fn txt_lookup<S: AsRef<str>>( host: S, ) -> Result<Vec<String>, ResolverError>
Resolve the TXT records for host, returning each record’s text.
Errors with ResolverError::Unsupported when the platform has no TXT resolver, and
ResolverError::Generic when the lookup fails or returns no records.
Sourcepub async fn ptr_lookup(ip_addr: IpAddr) -> Result<String, ResolverError>
pub async fn ptr_lookup(ip_addr: IpAddr) -> Result<String, ResolverError>
Reverse-resolve ip_addr to a hostname via its PTR record.
Errors with ResolverError::Generic when the lookup fails or returns no name.
Auto Trait Implementations§
impl Freeze for Resolver
impl RefUnwindSafe for Resolver
impl Send for Resolver
impl Sync for Resolver
impl Unpin for Resolver
impl UnsafeUnpin for Resolver
impl UnwindSafe for Resolver
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more