Skip to content

Commit

Permalink
doc: constructor asyncresolver
Browse files Browse the repository at this point in the history
  • Loading branch information
justRkive committed Nov 2, 2023
1 parent fa52d51 commit 96dc8e2
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions src/resolver/async_resolver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,16 @@ impl AsyncResolver {

/// Creates a new `AsyncResolver` with the given configuration.
///
/// # Example
/// ```
/// use std::time::Duration;
/// use dns_resolver::resolver::config::ResolverConfig;
/// use dns_resolver::resolver::async_resolver::AsyncResolver;
///
/// let config = ReolverConfig::default();
/// let resolver = AsyncResolver::new(config.clone());
/// assert_eq!(resolver.config, config);
/// ```
pub fn new(config: ResolverConfig)-> Self {
let async_resolver = AsyncResolver {
cache: DnsCache::new(),
Expand Down Expand Up @@ -119,9 +129,14 @@ mod async_resolver_test {
assert_eq!(resolver.config.get_timeout(), Duration::from_secs(TIMEOUT));
}


//TODO: test inner_lookup

// #[tokio::test]
// async fn inner_lookup() {
// let mut resolver = AsyncResolver::new(ResolverConfig::default());
// let domain_name = "example.com";
// let response = resolver.inner_lookup(domain_name).await;
// assert!(response.is_ok());
// }

#[ignore]
#[tokio::test]
Expand Down

0 comments on commit 96dc8e2

Please sign in to comment.