pub struct TestProbe<M: Send + 'static> { /* private fields */ }Implementations§
Source§impl<M: Send + 'static> TestProbe<M>
impl<M: Send + 'static> TestProbe<M>
pub fn new(name: &str) -> Self
pub fn actor_ref(&self) -> &ActorRef<M>
Sourcepub async fn expect_msg(
&mut self,
timeout: Duration,
) -> Result<M, TestProbeError>
pub async fn expect_msg( &mut self, timeout: Duration, ) -> Result<M, TestProbeError>
Wait for a single message (akka.net: ExpectMsg).
Sourcepub async fn expect_msg_pf<F>(
&mut self,
timeout: Duration,
pred: F,
) -> Result<M, TestProbeError>
pub async fn expect_msg_pf<F>( &mut self, timeout: Duration, pred: F, ) -> Result<M, TestProbeError>
Wait for a message that matches the given predicate.
akka.net: ExpectMsg<T>(Func<T, bool>).
Sourcepub async fn expect_no_msg(
&mut self,
timeout: Duration,
) -> Result<(), TestProbeError>
pub async fn expect_no_msg( &mut self, timeout: Duration, ) -> Result<(), TestProbeError>
Assert that no message arrives within the given timeout.
Sourcepub async fn expect_msg_class<T, F>(
&mut self,
timeout: Duration,
extract: F,
) -> Result<T, TestProbeError>
pub async fn expect_msg_class<T, F>( &mut self, timeout: Duration, extract: F, ) -> Result<T, TestProbeError>
Wait for a message and assert it matches the variant returned
by extract. Akka.NET: ExpectMsg<T>(...) where T selects
a sub-variant of the message enum. The extract closure
returns Some(payload) for the desired variant.
Sourcepub async fn receive_n(
&mut self,
n: usize,
timeout: Duration,
) -> Result<Vec<M>, TestProbeError>
pub async fn receive_n( &mut self, n: usize, timeout: Duration, ) -> Result<Vec<M>, TestProbeError>
Receive exactly n messages or return TestProbeError::Timeout
if timeout elapses before they all arrive.
Akka.NET: ReceiveN(int n, TimeSpan).
Sourcepub async fn receive_while<F>(
&mut self,
timeout: Duration,
pred: F,
) -> Result<Vec<M>, TestProbeError>
pub async fn receive_while<F>( &mut self, timeout: Duration, pred: F, ) -> Result<Vec<M>, TestProbeError>
Receive messages while pred returns true, stopping at the
first message for which pred returns false (that message is
discarded). Akka.NET: ReceiveWhile.
Sourcepub async fn fish_for_message<F>(
&mut self,
timeout: Duration,
pred: F,
) -> Result<M, TestProbeError>
pub async fn fish_for_message<F>( &mut self, timeout: Duration, pred: F, ) -> Result<M, TestProbeError>
Drain messages until one matches pred. Discards mismatches.
Akka.NET: FishForMessage.
Sourcepub async fn expect_all_of(
&mut self,
timeout: Duration,
expected: Vec<M>,
) -> Result<(), TestProbeError>
pub async fn expect_all_of( &mut self, timeout: Duration, expected: Vec<M>, ) -> Result<(), TestProbeError>
Receive expected.len() messages and assert that the multi-set
of received messages equals expected (order-insensitive).
Akka.NET: ExpectMsgAllOf.