pub struct Proxy { /* private fields */ }
Implementations§
source§impl Proxy
impl Proxy
pub fn addr(&self) -> Addr
pub fn send<M: Message>(&self, message: M) -> impl Future<Output = ()> + '_
pub fn send_to<M: Message>( &self, recipient: Addr, message: M ) -> impl Future<Output = ()> + '_
pub fn request<R: Request>( &self, request: R ) -> impl Future<Output = R::Response> + '_
pub fn respond<R: Request>(&self, token: ResponseToken<R>, response: R::Response)
pub fn recv(&mut self) -> impl Future<Output = Envelope> + '_
pub fn try_recv(&mut self) -> Option<Envelope>
sourcepub async fn sync(&mut self)
pub async fn sync(&mut self)
Waits until the testable actor handles all previously sent messages.
Now it’s implemented as multiple calls yield_now()
,
but the implementation can be changed in the future.
pub fn set_addr(&mut self, addr: Addr)
👎Deprecated
sourcepub fn set_recv_timeout(&mut self, recv_timeout: Duration)
pub fn set_recv_timeout(&mut self, recv_timeout: Duration)
Sets message wait time for recv
call.
pub fn non_exhaustive(&mut self)
sourcepub async fn subproxy(&self) -> Proxy
pub async fn subproxy(&self) -> Proxy
Creates a subproxy with a different address.
The main purpose is to test send_to(..)
and request(..).from(..)
calls. It’s likely to be changed in the future.