From ed7ca7fe079ef6e9ee419bafe54e517657846041 Mon Sep 17 00:00:00 2001 From: Nikolay Kim Date: Thu, 7 Feb 2019 21:50:20 -0800 Subject: [PATCH] make Message clonable and expose as public --- Cargo.toml | 2 +- src/lib.rs | 1 + src/message.rs | 9 +++++++++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index ea246762..f940ae86 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,7 +11,7 @@ documentation = "https://actix.rs/api/actix-http/stable/actix_http/" categories = ["network-programming", "asynchronous", "web-programming::http-server", "web-programming::websocket"] -license = "MIT/Apache-2.0" +license = "Apache-2.0" exclude = [".gitignore", ".travis.yml", ".cargo/config", "appveyor.yml"] edition = "2018" diff --git a/src/lib.rs b/src/lib.rs index f34da84c..932b5485 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -94,6 +94,7 @@ pub use self::config::{KeepAlive, ServiceConfig, ServiceConfigBuilder}; pub use self::error::{Error, ResponseError, Result}; pub use self::extensions::Extensions; pub use self::httpmessage::HttpMessage; +pub use self::message::{Message, RequestHead, ResponseHead}; pub use self::request::Request; pub use self::response::Response; pub use self::service::{SendError, SendResponse}; diff --git a/src/message.rs b/src/message.rs index 08edeef3..12da9eaf 100644 --- a/src/message.rs +++ b/src/message.rs @@ -169,6 +169,15 @@ impl Message { } } +impl Clone for Message { + fn clone(&self) -> Self { + Message { + inner: self.inner.clone(), + pool: self.pool, + } + } +} + impl std::ops::Deref for Message { type Target = T;