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§

source

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.

source

fn data(&self) -> &dyn Any

source

fn data_mut(&mut self) -> &mut dyn Any

Implementors§

source§

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.