pub struct Proxy { /* private fields */ }Expand description
A proxy for testing actors.
Implementations§
Source§impl Proxy
impl Proxy
Sourcepub fn node_launch_id(&self) -> NodeLaunchId
pub fn node_launch_id(&self) -> NodeLaunchId
Returns a launch ID of the topology.
It can be used to distinguish produced artifacts (logs, dumps, metrics) from different concurrent tests if the custom implementation is used.
Sourcepub fn unbounded_send<M: Message>(&self, message: M)
pub fn unbounded_send<M: Message>(&self, message: M)
See Context::unbounded_send() for details.
Sourcepub fn unbounded_send_to<M: Message>(&self, recipient: Addr, message: M)
pub fn unbounded_send_to<M: Message>(&self, recipient: Addr, message: M)
See Context::unbounded_send_to() for details.
Sourcepub fn send<M: Message>(&self, message: M) -> impl Future<Output = ()> + '_
pub fn send<M: Message>(&self, message: M) -> impl Future<Output = ()> + '_
See Context::send() for details.
Sourcepub fn send_to<M: Message>(
&self,
recipient: Addr,
message: M,
) -> impl Future<Output = ()> + '_
pub fn send_to<M: Message>( &self, recipient: Addr, message: M, ) -> impl Future<Output = ()> + '_
See Context::send_to() for details.
Sourcepub fn try_send<M: Message>(&self, message: M) -> Result<(), TrySendError<M>>
pub fn try_send<M: Message>(&self, message: M) -> Result<(), TrySendError<M>>
See Context::try_send() for details.
Sourcepub fn try_send_to<M: Message>(
&self,
recipient: Addr,
message: M,
) -> Result<(), TrySendError<M>>
pub fn try_send_to<M: Message>( &self, recipient: Addr, message: M, ) -> Result<(), TrySendError<M>>
See Context::try_send_to() for details.
Sourcepub fn request_fallible<R: Request>(
&self,
request: R,
) -> impl Future<Output = Result<R::Response, RequestError>>
pub fn request_fallible<R: Request>( &self, request: R, ) -> impl Future<Output = Result<R::Response, RequestError>>
Same as Self::request, but doesn’t unwraps the error.
Sourcepub fn request<R: Request>(
&self,
request: R,
) -> impl Future<Output = R::Response>
pub fn request<R: Request>( &self, request: R, ) -> impl Future<Output = R::Response>
See Context::request() for details.
Sourcepub fn request_to_fallible<R: Request>(
&self,
recipient: Addr,
request: R,
) -> impl Future<Output = Result<R::Response, RequestError>>
pub fn request_to_fallible<R: Request>( &self, recipient: Addr, request: R, ) -> impl Future<Output = Result<R::Response, RequestError>>
Same as Self::request_to, but doesn’t unwraps the errors.
Sourcepub fn request_to<R: Request>(
&self,
recipient: Addr,
request: R,
) -> impl Future<Output = R::Response>
pub fn request_to<R: Request>( &self, recipient: Addr, request: R, ) -> impl Future<Output = R::Response>
See Context::request_to() for details.
Sourcepub fn respond<R: Request>(
&self,
token: ResponseToken<R>,
response: R::Response,
)
pub fn respond<R: Request>( &self, token: ResponseToken<R>, response: R::Response, )
See Context::respond() for details.
Sourcepub fn recv(&mut self) -> impl Future<Output = Envelope> + '_
pub fn recv(&mut self) -> impl Future<Output = Envelope> + '_
See Context::recv() for details.
Sourcepub async fn try_recv(&mut self) -> Option<Envelope>
pub async fn try_recv(&mut self) -> Option<Envelope>
See Context::try_recv() for details.
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.
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.