Skip to content

Commit

Permalink
feat(client): add Protocol trait
Browse files Browse the repository at this point in the history
  • Loading branch information
mlalic committed Jun 2, 2015
1 parent aa297f4 commit 3417303
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/message.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,16 @@ use url::Url;
use method;
use version;
use traitobject;
use net::ContextVerifier;

/// The trait provides an API for creating new `HttpMessage`s depending on the underlying HTTP
/// protocol.
pub trait Protocol {
/// Creates a fresh `HttpMessage` bound to the given host, based on the given protocol scheme.
fn new_message(&self, host: &str, port: u16, scheme: &str) -> ::Result<Box<HttpMessage>>;
/// Sets the SSL verifier that should be used when establishing TLS-protected connections.
fn set_ssl_verifier(&mut self, verifier: ContextVerifier);
}

/// Describes a request.
#[derive(Clone, Debug)]
Expand Down

0 comments on commit 3417303

Please sign in to comment.