pub struct Handle<T, U> { /* private fields */ }Expand description
Drives a paired Mock.
A Handle receives the requests made to its Mock (via
next_request/poll_request, each of which yields a SendResponse
for replying), can fail the mock’s readiness with send_error, and can
limit how many requests the mock accepts with allow.
Implementations§
Source§impl<T, U> Handle<T, U>
impl<T, U> Handle<T, U>
Sourcepub fn poll_request(&mut self) -> Poll<Option<(T, SendResponse<U>)>>
pub fn poll_request(&mut self) -> Poll<Option<(T, SendResponse<U>)>>
Polls for the next request made to the Mock.
On Ready, yields the request together with a SendResponse used to
reply to it, or None once every Mock clone has been dropped.
Sourcepub async fn next_request(&mut self) -> Option<(T, SendResponse<U>)>
pub async fn next_request(&mut self) -> Option<(T, SendResponse<U>)>
Waits for the next request made to the Mock.
Resolves to the request together with a SendResponse used to reply to
it, or None once every Mock clone has been dropped.
Trait Implementations§
Auto Trait Implementations§
impl<T, U> Freeze for Handle<T, U>
impl<T, U> RefUnwindSafe for Handle<T, U>
impl<T, U> Send for Handle<T, U>
impl<T, U> Sync for Handle<T, U>
impl<T, U> Unpin for Handle<T, U>
impl<T, U> UnsafeUnpin for Handle<T, U>
impl<T, U> UnwindSafe for Handle<T, U>
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