[][src]Struct wayland_commons::socket::Socket

pub struct Socket { /* fields omitted */ }

A wayland socket

Methods

impl Socket[src]

pub fn send_msg(&self, bytes: &[u8], fds: &[RawFd]) -> NixResult<()>[src]

Send a single message to the socket

A single socket message can contain several wayland messages

The fds slice should not be longer than MAX_FDS_OUT, and the bytes slice should not be longer than MAX_BYTES_OUT otherwise the receiving end may lose some data.

pub fn rcv_msg(
    &self,
    buffer: &mut [u8],
    fds: &mut [RawFd]
) -> NixResult<(usize, usize)>
[src]

Receive a single message from the socket

Return the number of bytes received and the number of Fds received.

Errors with WouldBlock is no message is available.

A single socket message can contain several wayland messages.

The buffer slice should be at least MAX_BYTES_OUT long and the fds slice MAX_FDS_OUT long, otherwise some data of the received message may be lost.

Trait Implementations

impl Drop for Socket[src]

impl FromRawFd for Socket[src]

impl IntoRawFd for Socket[src]

impl AsRawFd for Socket[src]

Auto Trait Implementations

impl Send for Socket

impl Sync for Socket

Blanket Implementations

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]