Trait wayland_commons::MessageGroup [−][src]
pub trait MessageGroup: Sized { type Map; const MESSAGES: &'static [MessageDesc]; fn is_destructor(&self) -> bool; fn child<Meta: ObjectMetadata>(
opcode: u16,
version: u32,
meta: &Meta
) -> Option<Object<Meta>>; fn from_raw(msg: Message, map: &mut Self::Map) -> Result<Self, ()>; fn into_raw(self, send_id: u32) -> Message; }
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.
Associated Constants
const MESSAGES: &'static [MessageDesc]
Wire representation of this MessageGroup
Required Methods
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 child<Meta: ObjectMetadata>(
opcode: u16,
version: u32,
meta: &Meta
) -> Option<Object<Meta>>
opcode: u16,
version: u32,
meta: &Meta
) -> Option<Object<Meta>>
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