From 3417303a4a9aa4809729d53f0d018338e876da51 Mon Sep 17 00:00:00 2001 From: Marko Lalic Date: Thu, 28 May 2015 16:10:14 +0200 Subject: [PATCH] feat(client): add `Protocol` trait --- src/message.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/message.rs b/src/message.rs index 740075fe3c..541037c218 100644 --- a/src/message.rs +++ b/src/message.rs @@ -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>; + /// 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)]