Skip to content

Commit 3417303

Browse files
committed
feat(client): add Protocol trait
1 parent aa297f4 commit 3417303

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/message.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,16 @@ use url::Url;
1616
use method;
1717
use version;
1818
use traitobject;
19+
use net::ContextVerifier;
20+
21+
/// The trait provides an API for creating new `HttpMessage`s depending on the underlying HTTP
22+
/// protocol.
23+
pub trait Protocol {
24+
/// Creates a fresh `HttpMessage` bound to the given host, based on the given protocol scheme.
25+
fn new_message(&self, host: &str, port: u16, scheme: &str) -> ::Result<Box<HttpMessage>>;
26+
/// Sets the SSL verifier that should be used when establishing TLS-protected connections.
27+
fn set_ssl_verifier(&mut self, verifier: ContextVerifier);
28+
}
1929

2030
/// Describes a request.
2131
#[derive(Clone, Debug)]

0 commit comments

Comments
 (0)