pub trait MessageReceiver {
// Required methods
fn receiver(
&self,
) -> fn(this: ObjectId, opcode: u16, args: Vec<Arg>, client: &mut Client) -> Result<(), Error>;
fn data(&self) -> &dyn Any;
fn data_mut(&mut self) -> &mut dyn Any;
}
Required Methods§
Sourcefn receiver(
&self,
) -> fn(this: ObjectId, opcode: u16, args: Vec<Arg>, client: &mut Client) -> Result<(), Error>
fn receiver( &self, ) -> fn(this: ObjectId, opcode: u16, args: Vec<Arg>, client: &mut Client) -> Result<(), Error>
Returns a function pointer that will be called to handle requests targeting this object.
fn data(&self) -> &dyn Any
fn data_mut(&mut self) -> &mut dyn Any
Implementors§
impl<I: Interface, R: RequestReceiver<I>> MessageReceiver for RequestDispatcher<I, R>
Convert the raw Message into the appropriate request type by delegating to the associated |Request| type of |Interface|, and then invoke the receiver.