pub trait RequestReceiver<I: Interface>: Any + Sized {
// Required method
fn receive(
this: ObjectRef<Self>,
request: I::Incoming,
client: &mut Client,
) -> Result<(), Error>;
}
Expand description
The |RequestReceiver| trait is what high level code will use to work with request messages for a given type.
Required Methods§
Sourcefn receive(
this: ObjectRef<Self>,
request: I::Incoming,
client: &mut Client,
) -> Result<(), Error>
fn receive( this: ObjectRef<Self>, request: I::Incoming, client: &mut Client, ) -> Result<(), Error>
Handle a decoded message for the associated |Interface|.
|self| is not directly provided, but instead is provided as an |ObjectId| that can be used to get a reference to self.
Ex: struct MyReceiver;
impl RequestReceiver
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.