messaging_thread_pool/
request_with_response.rs

1use std::fmt::Debug;
2
3use crate::{pool_item::PoolItem, thread_request_response::ThreadRequestResponse};
4
5/// This trait allows for the pairing of requests and responses.
6///
7/// Implementing this trait for the API's request/response pairs allows the messaging
8/// infrastructure to guarantee the correctness of the messages sent and received
9/// by leveraging the type system.
10pub trait RequestWithResponse<P>: Debug + Into<ThreadRequestResponse<P>>
11where
12    P: PoolItem,
13    Self::Response: Debug + From<ThreadRequestResponse<P>> + Into<ThreadRequestResponse<P>>,
14{
15    type Response;
16}