Struct wayland_commons::socket::Socket
source · [−]pub struct Socket { /* private fields */ }
Expand description
A wayland socket
Implementations
sourceimpl Socket
impl Socket
sourcepub fn send_msg(&self, bytes: &[u8], fds: &[RawFd]) -> NixResult<()>
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.
sourcepub fn rcv_msg(
&self,
buffer: &mut [u8],
fds: &mut [RawFd]
) -> NixResult<(usize, usize)>
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.
sourcepub fn opt<O: GetSockOpt>(&self, opt: O) -> NixResult<O::Val>
pub fn opt<O: GetSockOpt>(&self, opt: O) -> NixResult<O::Val>
Retrieve the current value of the requested socket::GetSockOpt
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Socket
impl Send for Socket
impl Sync for Socket
impl Unpin for Socket
impl UnwindSafe for Socket
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