pub trait Handler:
Clone
+ Send
+ 'static {
type PublicKey: PublicKey;
type Request: Committable + Digestible + Codec;
type Response: Committable<Commitment = <Self::Request as Committable>::Commitment> + Digestible<Digest = <Self::Request as Digestible>::Digest> + Codec;
// Required method
fn process(
&mut self,
origin: Self::PublicKey,
request: Self::Request,
response: Sender<Self::Response>,
) -> impl Future<Output = ()> + Send;
}
Expand description
A Handler receives requests and (optionally) sends replies.
Required Associated Types§
Sourcetype PublicKey: PublicKey
type PublicKey: PublicKey
The PublicKey of the Originator.
Sourcetype Request: Committable + Digestible + Codec
type Request: Committable + Digestible + Codec
The type of request received.
Sourcetype Response: Committable<Commitment = <Self::Request as Committable>::Commitment> + Digestible<Digest = <Self::Request as Digestible>::Digest> + Codec
type Response: Committable<Commitment = <Self::Request as Committable>::Commitment> + Digestible<Digest = <Self::Request as Digestible>::Digest> + Codec
The type of response to send.
Required Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.