Struct wayland_commons::wire::Message
source · [−]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
sourceimpl 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
sourceimpl PartialEq<Message> for Message
impl PartialEq<Message> for Message
impl StructuralPartialEq for Message
Auto Trait Implementations
impl RefUnwindSafe for Message
impl Send for Message
impl Sync for Message
impl Unpin for Message
impl UnwindSafe for Message
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more