1
0
mirror of https://github.com/fafhrd91/actix-web synced 2024-11-24 00:21:08 +01: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, act: None,
state: ActorState::Started, state: ActorState::Started,
items: Vec::new(), items: Vec::new(),
address: ActorAddressCell::new(), address: ActorAddressCell::default(),
stream: VecDeque::new(), stream: VecDeque::new(),
app_state: state, app_state: state,
} }

View File

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

View File

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

View File

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