[][src]Trait wayland_server::MessageGroup

pub trait MessageGroup {
    type Map;

    const MESSAGES: &'static [MessageDesc];

    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
; }

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.

Associated Types

type Map

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

Loading content...

Associated Constants

const MESSAGES: &'static [MessageDesc]

Wire representation of this MessageGroup

Loading content...

Required methods

fn opcode(&self) -> u16

The opcode of this message

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.

fn since(&self) -> u32

The minimal object version for which this message exists

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

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

Construct a message from its raw representation

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

Turn this message into its raw representation

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

fn as_raw_c_in<F, T>(self, f: F) -> T where
    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.

Loading content...

Implementors

impl MessageGroup for NoMessage[src]

type Map = ()

impl MessageGroup for wayland_server::protocol::wl_buffer::Event[src]

type Map = ResourceMap

impl MessageGroup for wayland_server::protocol::wl_buffer::Request[src]

type Map = ResourceMap

impl MessageGroup for wayland_server::protocol::wl_callback::Event[src]

type Map = ResourceMap

impl MessageGroup for wayland_server::protocol::wl_callback::Request[src]

type Map = ResourceMap

impl MessageGroup for wayland_server::protocol::wl_compositor::Event[src]

type Map = ResourceMap

impl MessageGroup for wayland_server::protocol::wl_compositor::Request[src]

type Map = ResourceMap

impl MessageGroup for wayland_server::protocol::wl_data_device::Event[src]

type Map = ResourceMap

impl MessageGroup for wayland_server::protocol::wl_data_device::Request[src]

type Map = ResourceMap

impl MessageGroup for wayland_server::protocol::wl_data_device_manager::Event[src]

type Map = ResourceMap

impl MessageGroup for wayland_server::protocol::wl_data_device_manager::Request[src]

type Map = ResourceMap

impl MessageGroup for wayland_server::protocol::wl_data_offer::Event[src]

type Map = ResourceMap

impl MessageGroup for wayland_server::protocol::wl_data_offer::Request[src]

type Map = ResourceMap

impl MessageGroup for wayland_server::protocol::wl_data_source::Event[src]

type Map = ResourceMap

impl MessageGroup for wayland_server::protocol::wl_data_source::Request[src]

type Map = ResourceMap

impl MessageGroup for wayland_server::protocol::wl_keyboard::Event[src]

type Map = ResourceMap

impl MessageGroup for wayland_server::protocol::wl_keyboard::Request[src]

type Map = ResourceMap

impl MessageGroup for wayland_server::protocol::wl_output::Event[src]

type Map = ResourceMap

impl MessageGroup for wayland_server::protocol::wl_output::Request[src]

type Map = ResourceMap

impl MessageGroup for wayland_server::protocol::wl_pointer::Event[src]

type Map = ResourceMap

impl MessageGroup for wayland_server::protocol::wl_pointer::Request[src]

type Map = ResourceMap

impl MessageGroup for wayland_server::protocol::wl_region::Event[src]

type Map = ResourceMap

impl MessageGroup for wayland_server::protocol::wl_region::Request[src]

type Map = ResourceMap

impl MessageGroup for wayland_server::protocol::wl_seat::Event[src]

type Map = ResourceMap

impl MessageGroup for wayland_server::protocol::wl_seat::Request[src]

type Map = ResourceMap

impl MessageGroup for wayland_server::protocol::wl_shell::Event[src]

type Map = ResourceMap

impl MessageGroup for wayland_server::protocol::wl_shell::Request[src]

type Map = ResourceMap

impl MessageGroup for wayland_server::protocol::wl_shell_surface::Event[src]

type Map = ResourceMap

impl MessageGroup for wayland_server::protocol::wl_shell_surface::Request[src]

type Map = ResourceMap

impl MessageGroup for wayland_server::protocol::wl_shm::Event[src]

type Map = ResourceMap

impl MessageGroup for wayland_server::protocol::wl_shm::Request[src]

type Map = ResourceMap

impl MessageGroup for wayland_server::protocol::wl_shm_pool::Event[src]

type Map = ResourceMap

impl MessageGroup for wayland_server::protocol::wl_shm_pool::Request[src]

type Map = ResourceMap

impl MessageGroup for wayland_server::protocol::wl_subcompositor::Event[src]

type Map = ResourceMap

impl MessageGroup for wayland_server::protocol::wl_subcompositor::Request[src]

type Map = ResourceMap

impl MessageGroup for wayland_server::protocol::wl_subsurface::Event[src]

type Map = ResourceMap

impl MessageGroup for wayland_server::protocol::wl_subsurface::Request[src]

type Map = ResourceMap

impl MessageGroup for wayland_server::protocol::wl_surface::Event[src]

type Map = ResourceMap

impl MessageGroup for wayland_server::protocol::wl_surface::Request[src]

type Map = ResourceMap

impl MessageGroup for wayland_server::protocol::wl_touch::Event[src]

type Map = ResourceMap

impl MessageGroup for wayland_server::protocol::wl_touch::Request[src]

type Map = ResourceMap

Loading content...