pub struct ReplyChecker<R> {
rx: Receiver<Vec<u8>>,
_phantom: PhantomData<R>,
}Expand description
Receives the reply captured by a MockReceivedCommand.
Returned alongside the mock by MockReceivedCommand::new. Call
into_reply after the handler under test has
run to get the deserialized reply.
Fields§
§rx: Receiver<Vec<u8>>Receives the reply bytes sent by the handler under test.
_phantom: PhantomData<R>Binds the checker to the reply type R.
Implementations§
Source§impl<R: DeserializeOwned> ReplyChecker<R>
impl<R: DeserializeOwned> ReplyChecker<R>
Sourcepub async fn into_reply(self) -> Option<R>
pub async fn into_reply(self) -> Option<R>
Waits for and deserializes the reply sent by
reply.
Returns None if the handler dropped the command without replying.
Trait Implementations§
Auto Trait Implementations§
impl<R> !RefUnwindSafe for ReplyChecker<R>
impl<R> !UnwindSafe for ReplyChecker<R>
impl<R> Freeze for ReplyChecker<R>
impl<R> Send for ReplyChecker<R>where
R: Send,
impl<R> Sync for ReplyChecker<R>where
R: Sync,
impl<R> Unpin for ReplyChecker<R>where
R: Unpin,
impl<R> UnsafeUnpin for ReplyChecker<R>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more