1
0
mirror of https://github.com/actix/actix-extras.git synced 2024-11-24 16:02:59 +01:00

make Message clonable and expose as public

This commit is contained in:
Nikolay Kim 2019-02-07 21:50:20 -08:00
parent b0e36fdcf9
commit ed7ca7fe07
3 changed files with 11 additions and 1 deletions

View File

@ -11,7 +11,7 @@ documentation = "https://actix.rs/api/actix-http/stable/actix_http/"
categories = ["network-programming", "asynchronous", categories = ["network-programming", "asynchronous",
"web-programming::http-server", "web-programming::http-server",
"web-programming::websocket"] "web-programming::websocket"]
license = "MIT/Apache-2.0" license = "Apache-2.0"
exclude = [".gitignore", ".travis.yml", ".cargo/config", "appveyor.yml"] exclude = [".gitignore", ".travis.yml", ".cargo/config", "appveyor.yml"]
edition = "2018" edition = "2018"

View File

@ -94,6 +94,7 @@ pub use self::config::{KeepAlive, ServiceConfig, ServiceConfigBuilder};
pub use self::error::{Error, ResponseError, Result}; pub use self::error::{Error, ResponseError, Result};
pub use self::extensions::Extensions; pub use self::extensions::Extensions;
pub use self::httpmessage::HttpMessage; pub use self::httpmessage::HttpMessage;
pub use self::message::{Message, RequestHead, ResponseHead};
pub use self::request::Request; pub use self::request::Request;
pub use self::response::Response; pub use self::response::Response;
pub use self::service::{SendError, SendResponse}; pub use self::service::{SendError, SendResponse};

View File

@ -169,6 +169,15 @@ impl<T: Head> Message<T> {
} }
} }
impl<T: Head> Clone for Message<T> {
fn clone(&self) -> Self {
Message {
inner: self.inner.clone(),
pool: self.pool,
}
}
}
impl<T: Head> std::ops::Deref for Message<T> { impl<T: Head> std::ops::Deref for Message<T> {
type Target = T; type Target = T;