pub enum ThreadRequestResponse<P>where
P: PoolItem,{
ThreadShutdown(RequestResponse<P, ThreadShutdownRequest>),
ThreadAbort(RequestResponse<P, ThreadAbortRequest>),
ThreadEcho(RequestResponse<P, ThreadEchoRequest>),
AddPoolItem(RequestResponse<P, P::Init>),
RemovePoolItem(RequestResponse<P, RemovePoolItemRequest>),
MessagePoolItem(P::Api),
}Expand description
This enum defines all of the messages that can be used to communicate with the thread pool.
Each element of the enum takes a RequestResponse struct which can contain either a request
or a response
Variants§
ThreadShutdown(RequestResponse<P, ThreadShutdownRequest>)
Causes the message loop of the thread to be exited and the thread is rejoined to the main thread Give contained pool items the opportunity to (optionally) shut down a child thread pool
ThreadAbort(RequestResponse<P, ThreadAbortRequest>)
As shutdown but leaves all of the state thread state intact (for use in testing)
ThreadEcho(RequestResponse<P, ThreadEchoRequest>)
For testing thread communications in test
AddPoolItem(RequestResponse<P, P::Init>)
Add a new pool item to the thread pool The pool item will be assigned a thread within the thread pool and it will be instantiated there It remain on that thread for its entire life The form of the message to create the pool item is defined by the pool item
RemovePoolItem(RequestResponse<P, RemovePoolItemRequest>)
Requests that an item be removed from the thread pool The request is routed to the thread that has ownership and the pool item is dropped
MessagePoolItem(P::Api)
Send a message from the pool items defined api to a given pool item The message is routed to the owning thread and any work is performed there
Implementations§
Trait Implementations§
source§impl<P> Debug for ThreadRequestResponse<P>
impl<P> Debug for ThreadRequestResponse<P>
source§impl<P> From<AddResponse> for ThreadRequestResponse<P>where
P: PoolItem,
impl<P> From<AddResponse> for ThreadRequestResponse<P>where
P: PoolItem,
source§fn from(response: AddResponse) -> Self
fn from(response: AddResponse) -> Self
source§impl From<MeanRequest> for ThreadRequestResponse<Randoms>
impl From<MeanRequest> for ThreadRequestResponse<Randoms>
source§fn from(request: MeanRequest) -> Self
fn from(request: MeanRequest) -> Self
source§impl From<MeanResponse> for ThreadRequestResponse<Randoms>
impl From<MeanResponse> for ThreadRequestResponse<Randoms>
source§fn from(response: MeanResponse) -> Self
fn from(response: MeanResponse) -> Self
source§impl From<PanicRequest> for ThreadRequestResponse<Randoms>
impl From<PanicRequest> for ThreadRequestResponse<Randoms>
source§fn from(request: PanicRequest) -> Self
fn from(request: PanicRequest) -> Self
source§impl From<PanicResponse> for ThreadRequestResponse<Randoms>
impl From<PanicResponse> for ThreadRequestResponse<Randoms>
source§fn from(response: PanicResponse) -> Self
fn from(response: PanicResponse) -> Self
source§impl From<RandomsAddRequest> for ThreadRequestResponse<Randoms>
impl From<RandomsAddRequest> for ThreadRequestResponse<Randoms>
source§fn from(add_request: RandomsAddRequest) -> Self
fn from(add_request: RandomsAddRequest) -> Self
source§impl From<RandomsApi> for ThreadRequestResponse<Randoms>
impl From<RandomsApi> for ThreadRequestResponse<Randoms>
source§fn from(request_response: RandomsApi) -> Self
fn from(request_response: RandomsApi) -> Self
source§impl<P> From<RandomsBatchAddRequest<P>> for ThreadRequestResponse<RandomsBatch<P>>
impl<P> From<RandomsBatchAddRequest<P>> for ThreadRequestResponse<RandomsBatch<P>>
source§fn from(request: RandomsBatchAddRequest<P>) -> Self
fn from(request: RandomsBatchAddRequest<P>) -> Self
source§impl<P> From<RandomsBatchApi<P>> for ThreadRequestResponse<RandomsBatch<P>>
impl<P> From<RandomsBatchApi<P>> for ThreadRequestResponse<RandomsBatch<P>>
source§fn from(request_response: RandomsBatchApi<P>) -> Self
fn from(request_response: RandomsBatchApi<P>) -> Self
source§impl<P> From<RemovePoolItemRequest> for ThreadRequestResponse<P>where
P: PoolItem,
impl<P> From<RemovePoolItemRequest> for ThreadRequestResponse<P>where
P: PoolItem,
source§fn from(request: RemovePoolItemRequest) -> Self
fn from(request: RemovePoolItemRequest) -> Self
source§impl<T> From<RemovePoolItemResponse> for ThreadRequestResponse<T>where
T: PoolItem,
impl<T> From<RemovePoolItemResponse> for ThreadRequestResponse<T>where
T: PoolItem,
source§fn from(request: RemovePoolItemResponse) -> Self
fn from(request: RemovePoolItemResponse) -> Self
source§impl<P> From<SumOfSumsRequest> for ThreadRequestResponse<RandomsBatch<P>>
impl<P> From<SumOfSumsRequest> for ThreadRequestResponse<RandomsBatch<P>>
source§fn from(request: SumOfSumsRequest) -> Self
fn from(request: SumOfSumsRequest) -> Self
source§impl<P> From<SumOfSumsResponse> for ThreadRequestResponse<RandomsBatch<P>>
impl<P> From<SumOfSumsResponse> for ThreadRequestResponse<RandomsBatch<P>>
source§fn from(response: SumOfSumsResponse) -> Self
fn from(response: SumOfSumsResponse) -> Self
source§impl From<SumRequest> for ThreadRequestResponse<Randoms>
impl From<SumRequest> for ThreadRequestResponse<Randoms>
source§fn from(request: SumRequest) -> Self
fn from(request: SumRequest) -> Self
source§impl From<SumResponse> for ThreadRequestResponse<Randoms>
impl From<SumResponse> for ThreadRequestResponse<Randoms>
source§fn from(response: SumResponse) -> Self
fn from(response: SumResponse) -> Self
source§impl<P> From<ThreadAbortRequest> for ThreadRequestResponse<P>where
P: PoolItem,
impl<P> From<ThreadAbortRequest> for ThreadRequestResponse<P>where
P: PoolItem,
source§fn from(request: ThreadAbortRequest) -> Self
fn from(request: ThreadAbortRequest) -> Self
source§impl<T> From<ThreadAbortResponse> for ThreadRequestResponse<T>where
T: PoolItem,
impl<T> From<ThreadAbortResponse> for ThreadRequestResponse<T>where
T: PoolItem,
source§fn from(request: ThreadAbortResponse) -> Self
fn from(request: ThreadAbortResponse) -> Self
source§impl<P> From<ThreadEchoRequest> for ThreadRequestResponse<P>where
P: PoolItem,
impl<P> From<ThreadEchoRequest> for ThreadRequestResponse<P>where
P: PoolItem,
source§fn from(request: ThreadEchoRequest) -> Self
fn from(request: ThreadEchoRequest) -> Self
source§impl<T> From<ThreadEchoResponse> for ThreadRequestResponse<T>where
T: PoolItem,
impl<T> From<ThreadEchoResponse> for ThreadRequestResponse<T>where
T: PoolItem,
source§fn from(request: ThreadEchoResponse) -> Self
fn from(request: ThreadEchoResponse) -> Self
source§impl<P> From<ThreadRequestResponse<P>> for AddResponsewhere
P: PoolItem,
impl<P> From<ThreadRequestResponse<P>> for AddResponsewhere
P: PoolItem,
source§fn from(response: ThreadRequestResponse<P>) -> Self
fn from(response: ThreadRequestResponse<P>) -> Self
source§impl<P> From<ThreadRequestResponse<P>> for RemovePoolItemResponsewhere
P: PoolItem,
impl<P> From<ThreadRequestResponse<P>> for RemovePoolItemResponsewhere
P: PoolItem,
source§fn from(response: ThreadRequestResponse<P>) -> Self
fn from(response: ThreadRequestResponse<P>) -> Self
source§impl<P> From<ThreadRequestResponse<P>> for ThreadAbortResponsewhere
P: PoolItem,
impl<P> From<ThreadRequestResponse<P>> for ThreadAbortResponsewhere
P: PoolItem,
source§fn from(response: ThreadRequestResponse<P>) -> Self
fn from(response: ThreadRequestResponse<P>) -> Self
source§impl<P> From<ThreadRequestResponse<P>> for ThreadEchoResponsewhere
P: PoolItem,
impl<P> From<ThreadRequestResponse<P>> for ThreadEchoResponsewhere
P: PoolItem,
source§fn from(response: ThreadRequestResponse<P>) -> Self
fn from(response: ThreadRequestResponse<P>) -> Self
source§impl<P> From<ThreadRequestResponse<P>> for ThreadShutdownResponsewhere
P: PoolItem,
impl<P> From<ThreadRequestResponse<P>> for ThreadShutdownResponsewhere
P: PoolItem,
source§fn from(response: ThreadRequestResponse<P>) -> Self
fn from(response: ThreadRequestResponse<P>) -> Self
source§impl From<ThreadRequestResponse<Randoms>> for MeanRequest
impl From<ThreadRequestResponse<Randoms>> for MeanRequest
source§fn from(request: ThreadRequestResponse<Randoms>) -> Self
fn from(request: ThreadRequestResponse<Randoms>) -> Self
source§impl From<ThreadRequestResponse<Randoms>> for MeanResponse
impl From<ThreadRequestResponse<Randoms>> for MeanResponse
source§fn from(response: ThreadRequestResponse<Randoms>) -> Self
fn from(response: ThreadRequestResponse<Randoms>) -> Self
source§impl From<ThreadRequestResponse<Randoms>> for PanicRequest
impl From<ThreadRequestResponse<Randoms>> for PanicRequest
source§fn from(request: ThreadRequestResponse<Randoms>) -> Self
fn from(request: ThreadRequestResponse<Randoms>) -> Self
source§impl From<ThreadRequestResponse<Randoms>> for PanicResponse
impl From<ThreadRequestResponse<Randoms>> for PanicResponse
source§fn from(response: ThreadRequestResponse<Randoms>) -> Self
fn from(response: ThreadRequestResponse<Randoms>) -> Self
source§impl From<ThreadRequestResponse<Randoms>> for RandomsAddRequest
impl From<ThreadRequestResponse<Randoms>> for RandomsAddRequest
source§fn from(response: ThreadRequestResponse<Randoms>) -> Self
fn from(response: ThreadRequestResponse<Randoms>) -> Self
source§impl From<ThreadRequestResponse<Randoms>> for RandomsApi
impl From<ThreadRequestResponse<Randoms>> for RandomsApi
source§fn from(response: ThreadRequestResponse<Randoms>) -> Self
fn from(response: ThreadRequestResponse<Randoms>) -> Self
source§impl From<ThreadRequestResponse<Randoms>> for SumRequest
impl From<ThreadRequestResponse<Randoms>> for SumRequest
source§fn from(request: ThreadRequestResponse<Randoms>) -> Self
fn from(request: ThreadRequestResponse<Randoms>) -> Self
source§impl From<ThreadRequestResponse<Randoms>> for SumResponse
impl From<ThreadRequestResponse<Randoms>> for SumResponse
source§fn from(response: ThreadRequestResponse<Randoms>) -> Self
fn from(response: ThreadRequestResponse<Randoms>) -> Self
source§impl<P> From<ThreadRequestResponse<RandomsBatch<P>>> for RandomsBatchAddRequest<P>
impl<P> From<ThreadRequestResponse<RandomsBatch<P>>> for RandomsBatchAddRequest<P>
source§fn from(response: ThreadRequestResponse<RandomsBatch<P>>) -> Self
fn from(response: ThreadRequestResponse<RandomsBatch<P>>) -> Self
source§impl<P> From<ThreadRequestResponse<RandomsBatch<P>>> for RandomsBatchApi<P>
impl<P> From<ThreadRequestResponse<RandomsBatch<P>>> for RandomsBatchApi<P>
source§fn from(response: ThreadRequestResponse<RandomsBatch<P>>) -> Self
fn from(response: ThreadRequestResponse<RandomsBatch<P>>) -> Self
source§impl<P> From<ThreadRequestResponse<RandomsBatch<P>>> for SumOfSumsRequest
impl<P> From<ThreadRequestResponse<RandomsBatch<P>>> for SumOfSumsRequest
source§fn from(request: ThreadRequestResponse<RandomsBatch<P>>) -> Self
fn from(request: ThreadRequestResponse<RandomsBatch<P>>) -> Self
source§impl<P> From<ThreadRequestResponse<RandomsBatch<P>>> for SumOfSumsResponse
impl<P> From<ThreadRequestResponse<RandomsBatch<P>>> for SumOfSumsResponse
source§fn from(response: ThreadRequestResponse<RandomsBatch<P>>) -> Self
fn from(response: ThreadRequestResponse<RandomsBatch<P>>) -> Self
source§impl<P> From<ThreadShutdownRequest> for ThreadRequestResponse<P>where
P: PoolItem,
impl<P> From<ThreadShutdownRequest> for ThreadRequestResponse<P>where
P: PoolItem,
source§fn from(request: ThreadShutdownRequest) -> Self
fn from(request: ThreadShutdownRequest) -> Self
source§impl<T> From<ThreadShutdownResponse> for ThreadRequestResponse<T>where
T: PoolItem,
impl<T> From<ThreadShutdownResponse> for ThreadRequestResponse<T>where
T: PoolItem,
source§fn from(request: ThreadShutdownResponse) -> Self
fn from(request: ThreadShutdownResponse) -> Self
source§impl<P> PartialEq for ThreadRequestResponse<P>
impl<P> PartialEq for ThreadRequestResponse<P>
source§fn eq(&self, other: &ThreadRequestResponse<P>) -> bool
fn eq(&self, other: &ThreadRequestResponse<P>) -> bool
self and other values to be equal, and is used
by ==.source§impl<P> RequestWithResponse<P> for ThreadRequestResponse<P>where
P: PoolItem,
impl<P> RequestWithResponse<P> for ThreadRequestResponse<P>where
P: PoolItem,
A ThreadRequestResponse is always a RequestWithResponse