type ProxyItem<Request, Response, Error> = Arc<Mutex<Option<ResponseSender<Request, Response, Error>>>>;Expand description
An internal type representing the item that’s sent in the [broadcast] channel.
The actual type that matters is the ResponseSender but since there could be more than one
MockService verifying requests, the type must be wrapped so that it can be shared by all
receivers:
- The
Arcmakes sure the instance is on the heap, and can be shared properly between threads and dropped when no longer needed. - The [
Mutex] ensures only oneMockServiceinstance can reply to the received request. - The
Optionforces theMockServicethat handles the request to take ownership of it because sending a response also forces theResponseSenderto be dropped.
Aliased Type§
struct ProxyItem<Request, Response, Error> { /* private fields */ }Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...) attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 8 bytes