|
1 | 1 | // Import the necessary libraries |
2 | | -use async_std::net::TcpStream; // Provides functionality for TCP networking |
3 | | - // Rate limiting library |
4 | | -use reqwest::{header::HeaderValue, redirect, Method, Request}; // HTTP client library |
| 2 | +use async_std::net::TcpStream; // Import the `TcpStream` struct from the `async_std::net` module to provide functionality for TCP networking |
| 3 | +use reqwest::{header::HeaderValue, redirect, Method, Request}; // Import the necessary types from the `reqwest` crate for HTTP client functionality |
5 | 4 | use std::{ |
6 | | - error::Error, |
7 | | - net::{IpAddr, SocketAddr}, |
8 | | - time::Duration, |
9 | | -}; // Standard library modules for error handling, networking, and time |
10 | | -use tokio::sync::mpsc; |
| 5 | + error::Error, // Import the `Error` trait from the `std::error` module for error handling |
| 6 | + net::{IpAddr, SocketAddr}, // Import the `IpAddr` and `SocketAddr` structs from the `std::net` module for networking |
| 7 | + time::Duration, // Import the `Duration` struct from the `std::time` module for time-related functionality |
| 8 | +}; // Import various modules from the standard library for error handling, networking, and time |
| 9 | +use tokio::sync::mpsc; // Import the `mpsc` module from the `tokio::sync` crate for multi-producer, single-consumer communication primitives |
11 | 10 |
|
12 | 11 | // Import the `AsyncResolver` struct from the `hickory_resolver` crate |
13 | 12 | use hickory_resolver::AsyncResolver; |
14 | 13 |
|
15 | | -use crate::{Job, JobResult}; |
| 14 | +use crate::{Job, JobResult}; // Import the `Job` and `JobResult` types from the current crate |
16 | 15 |
|
17 | 16 | // Overall, this function is responsible for running a resolver asynchronously by receiving `Job` objects from the `rx` receiver and using the `resolver` to handle DNS resolution. |
18 | 17 | pub async fn run_resolver( |
|
0 commit comments