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§

source§

impl<P> ThreadRequestResponse<P>
where P: PoolItem,

source

pub fn id(&self) -> u64

Trait Implementations§

source§

impl<P> Debug for ThreadRequestResponse<P>
where P: PoolItem + Debug, P::Init: Debug, P::Api: Debug,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<P> From<AddResponse> for ThreadRequestResponse<P>
where P: PoolItem,

source§

fn from(response: AddResponse) -> Self

Converts to this type from the input type.
source§

impl From<MeanRequest> for ThreadRequestResponse<Randoms>

source§

fn from(request: MeanRequest) -> Self

Converts to this type from the input type.
source§

impl From<MeanResponse> for ThreadRequestResponse<Randoms>

source§

fn from(response: MeanResponse) -> Self

Converts to this type from the input type.
source§

impl From<PanicRequest> for ThreadRequestResponse<Randoms>

source§

fn from(request: PanicRequest) -> Self

Converts to this type from the input type.
source§

impl From<PanicResponse> for ThreadRequestResponse<Randoms>

source§

fn from(response: PanicResponse) -> Self

Converts to this type from the input type.
source§

impl From<RandomsAddRequest> for ThreadRequestResponse<Randoms>

source§

fn from(add_request: RandomsAddRequest) -> Self

Converts to this type from the input type.
source§

impl From<RandomsApi> for ThreadRequestResponse<Randoms>

source§

fn from(request_response: RandomsApi) -> Self

Converts to this type from the input type.
source§

impl<P> From<RandomsBatchAddRequest<P>> for ThreadRequestResponse<RandomsBatch<P>>

source§

fn from(request: RandomsBatchAddRequest<P>) -> Self

Converts to this type from the input type.
source§

impl<P> From<RandomsBatchApi<P>> for ThreadRequestResponse<RandomsBatch<P>>

source§

fn from(request_response: RandomsBatchApi<P>) -> Self

Converts to this type from the input type.
source§

impl<P> From<RemovePoolItemRequest> for ThreadRequestResponse<P>
where P: PoolItem,

source§

fn from(request: RemovePoolItemRequest) -> Self

Converts to this type from the input type.
source§

impl<T> From<RemovePoolItemResponse> for ThreadRequestResponse<T>
where T: PoolItem,

source§

fn from(request: RemovePoolItemResponse) -> Self

Converts to this type from the input type.
source§

impl<P> From<SumOfSumsRequest> for ThreadRequestResponse<RandomsBatch<P>>

source§

fn from(request: SumOfSumsRequest) -> Self

Converts to this type from the input type.
source§

impl<P> From<SumOfSumsResponse> for ThreadRequestResponse<RandomsBatch<P>>

source§

fn from(response: SumOfSumsResponse) -> Self

Converts to this type from the input type.
source§

impl From<SumRequest> for ThreadRequestResponse<Randoms>

source§

fn from(request: SumRequest) -> Self

Converts to this type from the input type.
source§

impl From<SumResponse> for ThreadRequestResponse<Randoms>

source§

fn from(response: SumResponse) -> Self

Converts to this type from the input type.
source§

impl<P> From<ThreadAbortRequest> for ThreadRequestResponse<P>
where P: PoolItem,

source§

fn from(request: ThreadAbortRequest) -> Self

Converts to this type from the input type.
source§

impl<T> From<ThreadAbortResponse> for ThreadRequestResponse<T>
where T: PoolItem,

source§

fn from(request: ThreadAbortResponse) -> Self

Converts to this type from the input type.
source§

impl<P> From<ThreadEchoRequest> for ThreadRequestResponse<P>
where P: PoolItem,

source§

fn from(request: ThreadEchoRequest) -> Self

Converts to this type from the input type.
source§

impl<T> From<ThreadEchoResponse> for ThreadRequestResponse<T>
where T: PoolItem,

source§

fn from(request: ThreadEchoResponse) -> Self

Converts to this type from the input type.
source§

impl<P> From<ThreadRequestResponse<P>> for AddResponse
where P: PoolItem,

source§

fn from(response: ThreadRequestResponse<P>) -> Self

Converts to this type from the input type.
source§

impl<P> From<ThreadRequestResponse<P>> for RemovePoolItemResponse
where P: PoolItem,

source§

fn from(response: ThreadRequestResponse<P>) -> Self

Converts to this type from the input type.
source§

impl<P> From<ThreadRequestResponse<P>> for ThreadAbortResponse
where P: PoolItem,

source§

fn from(response: ThreadRequestResponse<P>) -> Self

Converts to this type from the input type.
source§

impl<P> From<ThreadRequestResponse<P>> for ThreadEchoResponse
where P: PoolItem,

source§

fn from(response: ThreadRequestResponse<P>) -> Self

Converts to this type from the input type.
source§

impl<P> From<ThreadRequestResponse<P>> for ThreadShutdownResponse
where P: PoolItem,

source§

fn from(response: ThreadRequestResponse<P>) -> Self

Converts to this type from the input type.
source§

impl From<ThreadRequestResponse<Randoms>> for MeanRequest

source§

fn from(request: ThreadRequestResponse<Randoms>) -> Self

Converts to this type from the input type.
source§

impl From<ThreadRequestResponse<Randoms>> for MeanResponse

source§

fn from(response: ThreadRequestResponse<Randoms>) -> Self

Converts to this type from the input type.
source§

impl From<ThreadRequestResponse<Randoms>> for PanicRequest

source§

fn from(request: ThreadRequestResponse<Randoms>) -> Self

Converts to this type from the input type.
source§

impl From<ThreadRequestResponse<Randoms>> for PanicResponse

source§

fn from(response: ThreadRequestResponse<Randoms>) -> Self

Converts to this type from the input type.
source§

impl From<ThreadRequestResponse<Randoms>> for RandomsAddRequest

source§

fn from(response: ThreadRequestResponse<Randoms>) -> Self

Converts to this type from the input type.
source§

impl From<ThreadRequestResponse<Randoms>> for RandomsApi

source§

fn from(response: ThreadRequestResponse<Randoms>) -> Self

Converts to this type from the input type.
source§

impl From<ThreadRequestResponse<Randoms>> for SumRequest

source§

fn from(request: ThreadRequestResponse<Randoms>) -> Self

Converts to this type from the input type.
source§

impl From<ThreadRequestResponse<Randoms>> for SumResponse

source§

fn from(response: ThreadRequestResponse<Randoms>) -> Self

Converts to this type from the input type.
source§

impl<P> From<ThreadRequestResponse<RandomsBatch<P>>> for RandomsBatchAddRequest<P>

source§

fn from(response: ThreadRequestResponse<RandomsBatch<P>>) -> Self

Converts to this type from the input type.
source§

impl<P> From<ThreadRequestResponse<RandomsBatch<P>>> for RandomsBatchApi<P>

source§

fn from(response: ThreadRequestResponse<RandomsBatch<P>>) -> Self

Converts to this type from the input type.
source§

impl<P> From<ThreadRequestResponse<RandomsBatch<P>>> for SumOfSumsRequest

source§

fn from(request: ThreadRequestResponse<RandomsBatch<P>>) -> Self

Converts to this type from the input type.
source§

impl<P> From<ThreadRequestResponse<RandomsBatch<P>>> for SumOfSumsResponse

source§

fn from(response: ThreadRequestResponse<RandomsBatch<P>>) -> Self

Converts to this type from the input type.
source§

impl<P> From<ThreadShutdownRequest> for ThreadRequestResponse<P>
where P: PoolItem,

source§

fn from(request: ThreadShutdownRequest) -> Self

Converts to this type from the input type.
source§

impl<T> From<ThreadShutdownResponse> for ThreadRequestResponse<T>
where T: PoolItem,

source§

fn from(request: ThreadShutdownResponse) -> Self

Converts to this type from the input type.
source§

impl<P> PartialEq for ThreadRequestResponse<P>

source§

fn eq(&self, other: &ThreadRequestResponse<P>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<P> RequestWithResponse<P> for ThreadRequestResponse<P>
where P: PoolItem,

A ThreadRequestResponse is always a RequestWithResponse

source§

impl<P> StructuralPartialEq for ThreadRequestResponse<P>
where P: PoolItem,

Auto Trait Implementations§

§

impl<P> Freeze for ThreadRequestResponse<P>
where <P as PoolItem>::Api: Freeze, <P as PoolItem>::Init: Freeze,

§

impl<P> RefUnwindSafe for ThreadRequestResponse<P>

§

impl<P> Send for ThreadRequestResponse<P>

§

impl<P> Sync for ThreadRequestResponse<P>
where <P as PoolItem>::Api: Sync, <P as PoolItem>::Init: Sync,

§

impl<P> Unpin for ThreadRequestResponse<P>
where <P as PoolItem>::Api: Unpin, <P as PoolItem>::Init: Unpin,

§

impl<P> UnwindSafe for ThreadRequestResponse<P>
where <P as PoolItem>::Api: UnwindSafe, <P as PoolItem>::Init: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

source§

fn vzip(self) -> V

source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more