1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
extern crate tokio;
extern crate tokio_executor;
extern crate futures;
extern crate http;
extern crate base64;
extern crate hyper;
extern crate url;
pub mod client;
pub mod hurl;
pub mod serializer;
pub mod measurement;
use client::Credentials;
use client::http::HttpClient;
use hurl::hyper::HyperHurl;
use serializer::line::LineSerializer;
pub fn create_client<'a>(credentials: Credentials<'a>, hosts: Vec<&'a str>) -> HttpClient<'a> {
let mut client = HttpClient::new(credentials, Box::new(LineSerializer::new()), Box::new(HyperHurl::new()));
for host in hosts {
client.add_host(host);
}
client
}