1
0
Fork 0
mirror of https://github.com/actix/actix-web.git synced 2024-05-20 09:18:26 +00:00

better naming

This commit is contained in:
Nikolay Kim 2017-10-07 00:22:09 -07:00
parent ce4aea46c3
commit 127cc270da
4 changed files with 7 additions and 7 deletions

View file

@ -75,7 +75,7 @@ impl<A> HttpContext<A> where A: Actor<Context=Self> + Route {
act: None,
state: ActorState::Started,
items: Vec::new(),
address: ActorAddressCell::new(),
address: ActorAddressCell::default(),
stream: VecDeque::new(),
app_state: state,
}

View file

@ -25,9 +25,9 @@ impl Route for MyRoute {
{
if let Some(pl) = payload {
ctx.add_stream(pl);
Self::stream(MyRoute{req: Some(req)})
Self::http_stream(MyRoute{req: Some(req)})
} else {
Self::reply(req, httpcodes::HTTPOk)
Self::http_reply(req, httpcodes::HTTPOk)
}
}
}
@ -49,7 +49,7 @@ impl Handler<PayloadItem> for MyRoute {
ctx.write_eof();
}
Response::Empty()
Self::empty()
}
}

View file

@ -62,12 +62,12 @@ pub trait Route: Actor<Context=HttpContext<Self>> {
}
/// Create async response
fn stream(act: Self) -> HttpMessage<Self> {
fn http_stream(act: Self) -> HttpMessage<Self> {
HttpMessage::stream(act)
}
/// Create response
fn reply<I>(req: HttpRequest, msg: I) -> HttpMessage<Self>
fn http_reply<I>(req: HttpRequest, msg: I) -> HttpMessage<Self>
where I: IntoHttpResponse
{
HttpMessage::reply(req, msg)

View file

@ -58,7 +58,7 @@ impl Handler<(TcpStream, net::SocketAddr), io::Error> for HttpServer {
items: VecDeque::new(),
inactive: Vec::new(),
});
Response::Empty()
Self::empty()
}
}