Struct wayland_commons::socket::Socket [−][src]
pub struct Socket { /* fields omitted */ }A wayland socket
Methods
impl Socket[src]
impl Socketpub fn send_msg(&self, bytes: &[u8], fds: &[RawFd]) -> NixResult<()>[src]
pub fn send_msg(&self, bytes: &[u8], fds: &[RawFd]) -> NixResult<()>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]
pub fn rcv_msg(
&self,
buffer: &mut [u8],
fds: &mut [RawFd]
) -> NixResult<(usize, usize)>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 FromRawFd for Socket[src]
impl FromRawFd for Socketunsafe fn from_raw_fd(fd: RawFd) -> Socket[src]
unsafe fn from_raw_fd(fd: RawFd) -> SocketConstructs a new instance of Self from the given raw file descriptor. Read more
impl AsRawFd for Socket[src]
impl AsRawFd for Socketimpl IntoRawFd for Socket[src]
impl IntoRawFd for Socketfn into_raw_fd(self) -> RawFd[src]
fn into_raw_fd(self) -> RawFdConsumes this object, returning the raw underlying file descriptor. Read more
impl Drop for Socket[src]
impl Drop for Socket