wayland_bridge::object

Trait MessageReceiver

Source
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.