pub struct Message {
pub sender_id: u32,
pub opcode: u16,
pub args: SmallVec<[Argument; 4]>,
}
Expand description
A wire message
Fields§
§sender_id: u32
ID of the object sending this message
opcode: u16
Opcode of the message
args: SmallVec<[Argument; 4]>
Arguments of the message
Implementations§
Source§impl Message
impl Message
Sourcepub fn write_to_buffers(
&self,
payload: &mut [u32],
fds: &mut [RawFd],
) -> Result<(usize, usize), MessageWriteError>
pub fn write_to_buffers( &self, payload: &mut [u32], fds: &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.
Trait Implementations§
impl StructuralPartialEq for Message
Auto Trait Implementations§
impl Freeze for Message
impl RefUnwindSafe for Message
impl Send for Message
impl Sync for Message
impl Unpin for Message
impl UnwindSafe for Message
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more