Struct Mock Copy item path Source pub struct Mock<T, U> { }Expand description A mock Service .
Every request is forwarded to the paired Handle , which decides whether
and how to respond. Construct one with pair (or one of the spawn*
functions). Cloning a Mock produces another service backed by the same
Handle , so a single handle can observe the requests of every clone.
Performs copy-assignment from
source.
Read more Formats the value using the given formatter.
Read more Executes the destructor for this type.
Read more 🔬 This is a nightly-only experimental API. (pin_ergonomics)
Execute the destructor for this type, but different to
Drop::drop, it requires
self
to be pinned.
Read more Responses given by the service.
Errors produced by the service.
The future response value.
Returns
Poll::Ready(Ok(())) when the service is able to process requests.
Read more Process the request and return the response asynchronously.
Read more Immutably borrows from an owned value.
Read more Mutably borrows from an owned value.
Read more 🔬 This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from
self to
dest.
Read more Returns the argument unchanged.
Calls U::from(self).
That is, this conversion is whatever the implementation of
From <T> for U chooses to do.
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning.
Read more Uses borrowed data to replace owned data, usually by cloning.
Read more The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.