mirror of
https://github.com/fafhrd91/actix-web
synced 2024-12-03 20:02:12 +01:00
better naming
This commit is contained in:
parent
127cc270da
commit
9b7f2395e5
@ -100,10 +100,8 @@ impl<A> HttpMessage<A> where A: Actor<Context=HttpContext<A>> + Route
|
|||||||
HttpMessage(HttpMessageItem::Actor(act))
|
HttpMessage(HttpMessageItem::Actor(act))
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Create response with empty body
|
/// Send response
|
||||||
pub fn reply<I>(req: HttpRequest, msg: I) -> Self
|
pub fn reply<I: IntoHttpResponse>(req: HttpRequest, msg: I) -> Self {
|
||||||
where I: IntoHttpResponse
|
|
||||||
{
|
|
||||||
HttpMessage(HttpMessageItem::Message(msg.into_response(req)))
|
HttpMessage(HttpMessageItem::Message(msg.into_response(req)))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -66,10 +66,8 @@ pub trait Route: Actor<Context=HttpContext<Self>> {
|
|||||||
HttpMessage::stream(act)
|
HttpMessage::stream(act)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Create response
|
/// Send response
|
||||||
fn http_reply<I>(req: HttpRequest, msg: I) -> HttpMessage<Self>
|
fn http_reply<I: IntoHttpResponse>(req: HttpRequest, msg: I) -> HttpMessage<Self> {
|
||||||
where I: IntoHttpResponse
|
|
||||||
{
|
|
||||||
HttpMessage::reply(req, msg)
|
HttpMessage::reply(req, msg)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user