This commit is contained in:
Martin Algesten
2018-07-01 11:02:17 +02:00
parent a14e75fcbc
commit 2d2daf58ba
6 changed files with 112 additions and 26 deletions

View File

@@ -40,13 +40,20 @@ include!("unit.rs");
/// ```
#[derive(Debug, Default, Clone)]
pub struct Agent {
/// Copied into each request of this agent.
headers: Vec<Header>,
/// Reused agent state for repeated requests from this agent.
state: Arc<Mutex<Option<AgentState>>>,
}
/// Container of the state
///
/// *Internal API*.
#[derive(Debug)]
pub struct AgentState {
/// Reused connections between requests.
pool: ConnectionPool,
/// Cookies saved between requests.
jar: CookieJar,
}