pub trait MessageGroup: Sized {
    type Map;

    const MESSAGES: &'static [MessageDesc];

    // Required methods
    fn opcode(&self) -> u16;
    fn is_destructor(&self) -> bool;
    fn since(&self) -> u32;
    fn child<Meta>(
        opcode: u16,
        version: u32,
        meta: &Meta
    ) -> Option<Object<Meta>>
       where Meta: ObjectMetadata;
    fn from_raw(msg: Message, map: &mut Self::Map) -> Result<Self, ()>;
    fn into_raw(self, send_id: u32) -> Message;
    unsafe fn from_raw_c(
        obj: *mut c_void,
        opcode: u32,
        args: *const wl_argument
    ) -> Result<Self, ()>;
    fn as_raw_c_in<F, T>(self, f: F) -> T
       where F: FnOnce(u32, &mut [wl_argument]) -> T;
}
Expand description

A group of messages

This represents a group of message that can be serialized on the protocol wire. Typically the set of events or requests of a single interface.

Implementations of this trait are supposed to be generated using the wayland-scanner crate.

Required Associated Types§

source

type Map

The wrapper type for ObjectMap allowing the mapping of Object and NewId arguments to the object map during parsing.

Required Associated Constants§

source

const MESSAGES: &'static [MessageDesc]

Wire representation of this MessageGroup

Required Methods§

source

fn opcode(&self) -> u16

The opcode of this message

source

fn is_destructor(&self) -> bool

Whether this message is a destructor

If it is, once send or receive the associated object cannot be used any more.

source

fn since(&self) -> u32

The minimal object version for which this message exists

source

fn child<Meta>(opcode: u16, version: u32, meta: &Meta) -> Option<Object<Meta>>where Meta: ObjectMetadata,

Retrieve the child Object associated with this message if any

source

fn from_raw(msg: Message, map: &mut Self::Map) -> Result<Self, ()>

Construct a message from its raw representation

source

fn into_raw(self, send_id: u32) -> Message

Turn this message into its raw representation

source

unsafe fn from_raw_c( obj: *mut c_void, opcode: u32, args: *const wl_argument ) -> Result<Self, ()>

Construct a message of this group from its C representation

Safety

The pointers provided to this function must all be valid pointers from libwayland-client

source

fn as_raw_c_in<F, T>(self, f: F) -> Twhere F: FnOnce(u32, &mut [wl_argument]) -> T,

Build a C representation of this message

It can only be accessed from the provided closure, and this consumes the message.

Implementors§

source§

impl MessageGroup for NoMessage

source§

const MESSAGES: &'static [MessageDesc] = _

§

type Map = ()

source§

impl MessageGroup for wayland_client::protocol::wl_buffer::Event

source§

const MESSAGES: &'static [MessageDesc] = _

§

type Map = ProxyMap

source§

impl MessageGroup for wayland_client::protocol::wl_buffer::Request

source§

const MESSAGES: &'static [MessageDesc] = _

§

type Map = ProxyMap

source§

impl MessageGroup for wayland_client::protocol::wl_callback::Event

source§

const MESSAGES: &'static [MessageDesc] = _

§

type Map = ProxyMap

source§

impl MessageGroup for wayland_client::protocol::wl_callback::Request

source§

const MESSAGES: &'static [MessageDesc] = _

§

type Map = ProxyMap

source§

impl MessageGroup for wayland_client::protocol::wl_compositor::Event

source§

const MESSAGES: &'static [MessageDesc] = _

§

type Map = ProxyMap

source§

impl MessageGroup for wayland_client::protocol::wl_compositor::Request

source§

const MESSAGES: &'static [MessageDesc] = _

§

type Map = ProxyMap

source§

impl MessageGroup for wayland_client::protocol::wl_data_device::Event

source§

const MESSAGES: &'static [MessageDesc] = _

§

type Map = ProxyMap

source§

impl MessageGroup for wayland_client::protocol::wl_data_device::Request

source§

const MESSAGES: &'static [MessageDesc] = _

§

type Map = ProxyMap

source§

impl MessageGroup for wayland_client::protocol::wl_data_device_manager::Event

source§

const MESSAGES: &'static [MessageDesc] = _

§

type Map = ProxyMap

source§

impl MessageGroup for wayland_client::protocol::wl_data_device_manager::Request

source§

const MESSAGES: &'static [MessageDesc] = _

§

type Map = ProxyMap

source§

impl MessageGroup for wayland_client::protocol::wl_data_offer::Event

source§

const MESSAGES: &'static [MessageDesc] = _

§

type Map = ProxyMap

source§

impl MessageGroup for wayland_client::protocol::wl_data_offer::Request

source§

const MESSAGES: &'static [MessageDesc] = _

§

type Map = ProxyMap

source§

impl MessageGroup for wayland_client::protocol::wl_data_source::Event

source§

const MESSAGES: &'static [MessageDesc] = _

§

type Map = ProxyMap

source§

impl MessageGroup for wayland_client::protocol::wl_data_source::Request

source§

const MESSAGES: &'static [MessageDesc] = _

§

type Map = ProxyMap

source§

impl MessageGroup for wayland_client::protocol::wl_display::Event

source§

const MESSAGES: &'static [MessageDesc] = _

§

type Map = ProxyMap

source§

impl MessageGroup for wayland_client::protocol::wl_display::Request

source§

const MESSAGES: &'static [MessageDesc] = _

§

type Map = ProxyMap

source§

impl MessageGroup for wayland_client::protocol::wl_keyboard::Event

source§

const MESSAGES: &'static [MessageDesc] = _

§

type Map = ProxyMap

source§

impl MessageGroup for wayland_client::protocol::wl_keyboard::Request

source§

const MESSAGES: &'static [MessageDesc] = _

§

type Map = ProxyMap

source§

impl MessageGroup for wayland_client::protocol::wl_output::Event

source§

const MESSAGES: &'static [MessageDesc] = _

§

type Map = ProxyMap

source§

impl MessageGroup for wayland_client::protocol::wl_output::Request

source§

const MESSAGES: &'static [MessageDesc] = _

§

type Map = ProxyMap

source§

impl MessageGroup for wayland_client::protocol::wl_pointer::Event

source§

const MESSAGES: &'static [MessageDesc] = _

§

type Map = ProxyMap

source§

impl MessageGroup for wayland_client::protocol::wl_pointer::Request

source§

const MESSAGES: &'static [MessageDesc] = _

§

type Map = ProxyMap

source§

impl MessageGroup for wayland_client::protocol::wl_region::Event

source§

const MESSAGES: &'static [MessageDesc] = _

§

type Map = ProxyMap

source§

impl MessageGroup for wayland_client::protocol::wl_region::Request

source§

const MESSAGES: &'static [MessageDesc] = _

§

type Map = ProxyMap

source§

impl MessageGroup for wayland_client::protocol::wl_registry::Event

source§

const MESSAGES: &'static [MessageDesc] = _

§

type Map = ProxyMap

source§

impl MessageGroup for wayland_client::protocol::wl_registry::Request

source§

const MESSAGES: &'static [MessageDesc] = _

§

type Map = ProxyMap

source§

impl MessageGroup for wayland_client::protocol::wl_seat::Event

source§

const MESSAGES: &'static [MessageDesc] = _

§

type Map = ProxyMap

source§

impl MessageGroup for wayland_client::protocol::wl_seat::Request

source§

const MESSAGES: &'static [MessageDesc] = _

§

type Map = ProxyMap

source§

impl MessageGroup for wayland_client::protocol::wl_shell::Event

source§

const MESSAGES: &'static [MessageDesc] = _

§

type Map = ProxyMap

source§

impl MessageGroup for wayland_client::protocol::wl_shell::Request

source§

const MESSAGES: &'static [MessageDesc] = _

§

type Map = ProxyMap

source§

impl MessageGroup for wayland_client::protocol::wl_shell_surface::Event

source§

const MESSAGES: &'static [MessageDesc] = _

§

type Map = ProxyMap

source§

impl MessageGroup for wayland_client::protocol::wl_shell_surface::Request

source§

const MESSAGES: &'static [MessageDesc] = _

§

type Map = ProxyMap

source§

impl MessageGroup for wayland_client::protocol::wl_shm::Event

source§

const MESSAGES: &'static [MessageDesc] = _

§

type Map = ProxyMap

source§

impl MessageGroup for wayland_client::protocol::wl_shm::Request

source§

const MESSAGES: &'static [MessageDesc] = _

§

type Map = ProxyMap

source§

impl MessageGroup for wayland_client::protocol::wl_shm_pool::Event

source§

const MESSAGES: &'static [MessageDesc] = _

§

type Map = ProxyMap

source§

impl MessageGroup for wayland_client::protocol::wl_shm_pool::Request

source§

const MESSAGES: &'static [MessageDesc] = _

§

type Map = ProxyMap

source§

impl MessageGroup for wayland_client::protocol::wl_subcompositor::Event

source§

const MESSAGES: &'static [MessageDesc] = _

§

type Map = ProxyMap

source§

impl MessageGroup for wayland_client::protocol::wl_subcompositor::Request

source§

const MESSAGES: &'static [MessageDesc] = _

§

type Map = ProxyMap

source§

impl MessageGroup for wayland_client::protocol::wl_subsurface::Event

source§

const MESSAGES: &'static [MessageDesc] = _

§

type Map = ProxyMap

source§

impl MessageGroup for wayland_client::protocol::wl_subsurface::Request

source§

const MESSAGES: &'static [MessageDesc] = _

§

type Map = ProxyMap

source§

impl MessageGroup for wayland_client::protocol::wl_surface::Event

source§

const MESSAGES: &'static [MessageDesc] = _

§

type Map = ProxyMap

source§

impl MessageGroup for wayland_client::protocol::wl_surface::Request

source§

const MESSAGES: &'static [MessageDesc] = _

§

type Map = ProxyMap

source§

impl MessageGroup for wayland_client::protocol::wl_touch::Event

source§

const MESSAGES: &'static [MessageDesc] = _

§

type Map = ProxyMap

source§

impl MessageGroup for wayland_client::protocol::wl_touch::Request

source§

const MESSAGES: &'static [MessageDesc] = _

§

type Map = ProxyMap