mirror of https://github.com/fafhrd91/actix-web
add panic and comment
This commit is contained in:
parent
9a3ba6d04c
commit
0819cfbe7b
|
@ -343,9 +343,17 @@ impl ResponseHead {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct Message<T: Head> {
|
pub struct Message<T: Head> {
|
||||||
|
// Rc here should not be cloned by anyone.
|
||||||
|
// It's used to reuse allocation of T and no shared ownership is allowed.
|
||||||
head: Rc<T>,
|
head: Rc<T>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl<T: Head> Clone for Message<T> {
|
||||||
|
fn clone(&self) -> Self {
|
||||||
|
panic!("Message<T> type should not be Clone.")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
impl<T: Head> Message<T> {
|
impl<T: Head> Message<T> {
|
||||||
/// Get new message from the pool of objects
|
/// Get new message from the pool of objects
|
||||||
pub fn new() -> Self {
|
pub fn new() -> Self {
|
||||||
|
|
Loading…
Reference in New Issue