Add some short docstrings for types. (#225)
These types were missing a short docstring, leaving the comment space to their right blank on the crate page. Also, this takes advantage of intra-rustdoc links to link terms: https://github.com/rust-lang/rfcs/blob/master/text/1946-intra-rustdoc-links.md
This commit is contained in:
committed by
GitHub
parent
fade03b54e
commit
0321ea043d
@@ -12,6 +12,7 @@ use {
|
|||||||
cookie_store::CookieStore,
|
cookie_store::CookieStore,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/// Accumulates options towards building an [Agent].
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub struct AgentBuilder {
|
pub struct AgentBuilder {
|
||||||
config: AgentConfig,
|
config: AgentConfig,
|
||||||
|
|||||||
@@ -231,7 +231,7 @@ pub use serde_json::{to_value as serde_to_value, Map as SerdeMap, Value as Serde
|
|||||||
use once_cell::sync::Lazy;
|
use once_cell::sync::Lazy;
|
||||||
use std::sync::atomic::{AtomicBool, Ordering};
|
use std::sync::atomic::{AtomicBool, Ordering};
|
||||||
|
|
||||||
/// Creates an agent builder.
|
/// Creates an [AgentBuilder].
|
||||||
pub fn builder() -> AgentBuilder {
|
pub fn builder() -> AgentBuilder {
|
||||||
AgentBuilder::new()
|
AgentBuilder::new()
|
||||||
}
|
}
|
||||||
@@ -253,7 +253,7 @@ pub fn is_test(is: bool) -> bool {
|
|||||||
return x;
|
return x;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Agents are used to keep state between requests.
|
/// Agents are used to hold configuration and keep state between requests.
|
||||||
pub fn agent() -> Agent {
|
pub fn agent() -> Agent {
|
||||||
#[cfg(not(test))]
|
#[cfg(not(test))]
|
||||||
if is_test(false) {
|
if is_test(false) {
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ use std::io::Result as IoResult;
|
|||||||
use std::net::{SocketAddr, ToSocketAddrs};
|
use std::net::{SocketAddr, ToSocketAddrs};
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
|
|
||||||
|
/// A custom resolver to override the default DNS behavior.
|
||||||
pub trait Resolver: Send + Sync {
|
pub trait Resolver: Send + Sync {
|
||||||
fn resolve(&self, netloc: &str) -> IoResult<Vec<SocketAddr>>;
|
fn resolve(&self, netloc: &str) -> IoResult<Vec<SocketAddr>>;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user