Struct wayland_commons::wire::Message
source · Expand description
A wire message
Fields§
§sender_id: u32ID of the object sending this message
opcode: u16Opcode of the message
args: Vec<Argument>Arguments of the message
Implementations§
source§impl Message
impl Message
sourcepub fn write_to_buffers<'a, 'b>(
&self,
payload: &'a mut [u32],
fds: &'b mut [RawFd]
) -> Result<(usize, usize), MessageWriteError>
pub fn write_to_buffers<'a, 'b>(
&self,
payload: &'a mut [u32],
fds: &'b mut [RawFd]
) -> Result<(usize, usize), MessageWriteError>
Serialize the contents of this message into provided buffers
Returns the number of elements written in each buffer
Any serialized Fd will be dup()-ed in the process
sourcepub fn from_raw<'a, 'b>(
raw: &'a [u32],
signature: &[ArgumentType],
fds: &'b [RawFd]
) -> Result<(Message, &'a [u32], &'b [RawFd]), MessageParseError>
pub fn from_raw<'a, 'b>(
raw: &'a [u32],
signature: &[ArgumentType],
fds: &'b [RawFd]
) -> Result<(Message, &'a [u32], &'b [RawFd]), MessageParseError>
Attempts to parse a single wayland message with the given signature.
If the buffers contains several messages, only the first one will be parsed, and the unused tail of the buffers is returned. If a single message was present, the returned slices should thus be empty.
Errors if the message is malformed.