mirror of
https://github.com/actix/actix-extras.git
synced 2024-11-23 15:51:06 +01:00
better naming
This commit is contained in:
parent
ce4aea46c3
commit
127cc270da
@ -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,
|
||||
}
|
||||
|
@ -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()
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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)
|
||||
|
@ -58,7 +58,7 @@ impl Handler<(TcpStream, net::SocketAddr), io::Error> for HttpServer {
|
||||
items: VecDeque::new(),
|
||||
inactive: Vec::new(),
|
||||
});
|
||||
Response::Empty()
|
||||
Self::empty()
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user