diff --git a/src/context.rs b/src/context.rs index 614184d1d..19a2b4a0c 100644 --- a/src/context.rs +++ b/src/context.rs @@ -8,7 +8,7 @@ use smallvec::SmallVec; use actix::{Actor, ActorState, ActorContext, AsyncContext, Address, SyncAddress, Handler, ResponseType, MessageResult, SpawnHandle}; use actix::fut::ActorFuture; -use actix::dev::{AsyncContextApi, ContextImpl, Envelope, ToEnvelope, RemoteEnvelope}; +use actix::dev::{ContextImpl, Envelope, ToEnvelope, RemoteEnvelope}; use body::{Body, Binary}; use error::{Error, ErrorInternalServerError}; @@ -81,14 +81,12 @@ impl AsyncContext for HttpContext where A: Actor fn cancel_future(&mut self, handle: SpawnHandle) -> bool { self.inner.cancel_future(handle) } -} - -#[doc(hidden)] -impl AsyncContextApi for HttpContext where A: Actor { + #[doc(hidden)] #[inline] - fn unsync_address(&mut self) -> Address { + fn local_address(&mut self) -> Address { self.inner.unsync_address() } + #[doc(hidden)] #[inline] fn sync_address(&mut self) -> SyncAddress { self.inner.sync_address() @@ -211,7 +209,7 @@ impl ToEnvelope for HttpContext where A: Actor>, { #[inline] - fn pack_msg(msg: M, tx: Option>>) -> Envelope + fn pack(msg: M, tx: Option>>) -> Envelope where A: Handler, M: ResponseType + Send + 'static, M::Item: Send, M::Error: Send { diff --git a/src/ws/context.rs b/src/ws/context.rs index 6c0598b7e..d977a69b5 100644 --- a/src/ws/context.rs +++ b/src/ws/context.rs @@ -7,7 +7,7 @@ use smallvec::SmallVec; use actix::{Actor, ActorState, ActorContext, AsyncContext, Address, SyncAddress, Handler, ResponseType, SpawnHandle, MessageResult}; use actix::fut::ActorFuture; -use actix::dev::{AsyncContextApi, ContextImpl, Envelope, ToEnvelope, RemoteEnvelope}; +use actix::dev::{ContextImpl, Envelope, ToEnvelope, RemoteEnvelope}; use body::{Body, Binary}; use error::{Error, ErrorInternalServerError}; @@ -64,16 +64,14 @@ impl AsyncContext for WebsocketContext where A: Actor bool { self.inner.cancel_future(handle) } -} - -#[doc(hidden)] -impl AsyncContextApi for WebsocketContext where A: Actor { + #[doc(hidden)] #[inline] - fn unsync_address(&mut self) -> Address { + fn local_address(&mut self) -> Address { self.inner.unsync_address() } + #[doc(hidden)] #[inline] fn sync_address(&mut self) -> SyncAddress { self.inner.sync_address() @@ -235,7 +233,7 @@ impl ToEnvelope for WebsocketContext where A: Actor>, { #[inline] - fn pack_msg(msg: M, tx: Option>>) -> Envelope + fn pack(msg: M, tx: Option>>) -> Envelope where A: Handler, M: ResponseType + Send + 'static, M::Item: Send, M::Error: Send { RemoteEnvelope::envelope(msg, tx).into()