1
0
mirror of https://github.com/fafhrd91/actix-web synced 2025-08-21 13:15:38 +02:00

websocket support

This commit is contained in:
Nikolay Kim
2017-10-07 21:48:00 -07:00
parent 4234f133d2
commit f2d20514fa
14 changed files with 1232 additions and 64 deletions

View File

@@ -101,8 +101,13 @@ impl<A> HttpMessage<A> where A: Actor<Context=HttpContext<A>> + Route
}
/// Send response
pub fn reply<I: IntoHttpResponse>(req: HttpRequest, msg: I) -> Self {
HttpMessage(HttpMessageItem::Message(msg.into_response(req)))
pub fn reply(msg: HttpResponse) -> Self {
HttpMessage(HttpMessageItem::Message(msg))
}
/// Send response
pub fn reply_with<I: IntoHttpResponse>(req: HttpRequest, msg: I) -> Self {
HttpMessage(HttpMessageItem::Message(msg.response(req)))
}
pub(crate) fn into(self, mut ctx: HttpContext<A>) -> Task {