pub struct SendmsgConnection { /* private fields */ }Expand description
A variant of the UnixStream connection that uses sendmsg to send data
and recvmsg to receive it.
The main difference between this type and StdConnection<UnixStream> is
that this type supports file descriptor passing. This is useful for
extensions that require file descriptor passing.
Implementations§
Source§impl SendmsgConnection
impl SendmsgConnection
Sourcepub fn new(stream: UnixStream) -> Self
pub fn new(stream: UnixStream) -> Self
Create a new connection from a UnixStream.
Sourcepub fn into_stream(self) -> UnixStream
pub fn into_stream(self) -> UnixStream
Convert this object back into a UnixStream.
Trait Implementations§
Source§impl AsMut<UnixStream> for SendmsgConnection
impl AsMut<UnixStream> for SendmsgConnection
Source§fn as_mut(&mut self) -> &mut UnixStream
fn as_mut(&mut self) -> &mut UnixStream
Converts this type into a mutable reference of the (usually inferred) input type.
Source§impl AsRawFd for SendmsgConnection
impl AsRawFd for SendmsgConnection
Source§impl AsRef<UnixStream> for SendmsgConnection
impl AsRef<UnixStream> for SendmsgConnection
Source§fn as_ref(&self) -> &UnixStream
fn as_ref(&self) -> &UnixStream
Converts this type into a shared reference of the (usually inferred) input type.
Source§impl Borrow<UnixStream> for SendmsgConnection
impl Borrow<UnixStream> for SendmsgConnection
Source§fn borrow(&self) -> &UnixStream
fn borrow(&self) -> &UnixStream
Immutably borrows from an owned value. Read more
Source§impl BorrowMut<UnixStream> for SendmsgConnection
impl BorrowMut<UnixStream> for SendmsgConnection
Source§fn borrow_mut(&mut self) -> &mut UnixStream
fn borrow_mut(&mut self) -> &mut UnixStream
Mutably borrows from an owned value. Read more
Source§impl Connection for &SendmsgConnection
impl Connection for &SendmsgConnection
Source§fn send_slices_and_fds(
&mut self,
iov: &[IoSlice<'_>],
fds: &mut Vec<Fd>,
) -> Result<usize>
fn send_slices_and_fds( &mut self, iov: &[IoSlice<'_>], fds: &mut Vec<Fd>, ) -> Result<usize>
Write a series of I/O slices and a series of file descriptors to
the X11 server. Read more
Source§fn send_slices(&mut self, iov: &[IoSlice<'_>]) -> Result<usize>
fn send_slices(&mut self, iov: &[IoSlice<'_>]) -> Result<usize>
Write a series of I/O slices to the X11 server. Read more
Source§fn send_slice(&mut self, buffer: &[u8]) -> Result<usize>
fn send_slice(&mut self, buffer: &[u8]) -> Result<usize>
Write a slice of data to the X11 server. Read more
Source§fn recv_slices_and_fds(
&mut self,
slices: &mut [IoSliceMut<'_>],
fds: &mut Vec<Fd>,
) -> Result<usize>
fn recv_slices_and_fds( &mut self, slices: &mut [IoSliceMut<'_>], fds: &mut Vec<Fd>, ) -> Result<usize>
Read data to a series of I/O slices and a buffer for file
descriptors. Read more
Source§fn recv_slice(&mut self, slice: &mut [u8]) -> Result<usize>
fn recv_slice(&mut self, slice: &mut [u8]) -> Result<usize>
Read data for a single I/O slice. Read more
Source§fn non_blocking_recv_slices_and_fds(
&mut self,
slices: &mut [IoSliceMut<'_>],
fds: &mut Vec<Fd>,
) -> Result<usize>
fn non_blocking_recv_slices_and_fds( &mut self, slices: &mut [IoSliceMut<'_>], fds: &mut Vec<Fd>, ) -> Result<usize>
Receive data from the X11 server into a set of I/O slices, in a
non-blocking manner. Read more
Source§impl Connection for SendmsgConnection
impl Connection for SendmsgConnection
Source§fn send_slices_and_fds(
&mut self,
iov: &[IoSlice<'_>],
fds: &mut Vec<Fd>,
) -> Result<usize>
fn send_slices_and_fds( &mut self, iov: &[IoSlice<'_>], fds: &mut Vec<Fd>, ) -> Result<usize>
Write a series of I/O slices and a series of file descriptors to
the X11 server. Read more
Source§fn send_slices(&mut self, iov: &[IoSlice<'_>]) -> Result<usize>
fn send_slices(&mut self, iov: &[IoSlice<'_>]) -> Result<usize>
Write a series of I/O slices to the X11 server. Read more
Source§fn send_slice(&mut self, buffer: &[u8]) -> Result<usize>
fn send_slice(&mut self, buffer: &[u8]) -> Result<usize>
Write a slice of data to the X11 server. Read more
Source§fn recv_slices_and_fds(
&mut self,
slices: &mut [IoSliceMut<'_>],
fds: &mut Vec<Fd>,
) -> Result<usize>
fn recv_slices_and_fds( &mut self, slices: &mut [IoSliceMut<'_>], fds: &mut Vec<Fd>, ) -> Result<usize>
Read data to a series of I/O slices and a buffer for file
descriptors. Read more
Source§fn recv_slice(&mut self, slice: &mut [u8]) -> Result<usize>
fn recv_slice(&mut self, slice: &mut [u8]) -> Result<usize>
Read data for a single I/O slice. Read more
Source§fn non_blocking_recv_slices_and_fds(
&mut self,
slices: &mut [IoSliceMut<'_>],
fds: &mut Vec<Fd>,
) -> Result<usize>
fn non_blocking_recv_slices_and_fds( &mut self, slices: &mut [IoSliceMut<'_>], fds: &mut Vec<Fd>, ) -> Result<usize>
Receive data from the X11 server into a set of I/O slices, in a
non-blocking manner. Read more
Source§impl Debug for SendmsgConnection
impl Debug for SendmsgConnection
Source§impl From<SendmsgConnection> for UnixStream
impl From<SendmsgConnection> for UnixStream
Source§fn from(conn: SendmsgConnection) -> Self
fn from(conn: SendmsgConnection) -> Self
Converts to this type from the input type.
Source§impl From<UnixStream> for SendmsgConnection
impl From<UnixStream> for SendmsgConnection
Source§fn from(stream: UnixStream) -> Self
fn from(stream: UnixStream) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for SendmsgConnection
impl RefUnwindSafe for SendmsgConnection
impl Send for SendmsgConnection
impl Sync for SendmsgConnection
impl Unpin for SendmsgConnection
impl UnwindSafe for SendmsgConnection
Blanket Implementations§
Source§impl<T> AsRawFilelike for Twhere
T: AsRawFd,
impl<T> AsRawFilelike for Twhere
T: AsRawFd,
Source§fn as_raw_filelike(&self) -> i32
fn as_raw_filelike(&self) -> i32
Returns the raw value.
Source§impl<T> AsRawSocketlike for Twhere
T: AsRawFd,
impl<T> AsRawSocketlike for Twhere
T: AsRawFd,
Source§fn as_raw_socketlike(&self) -> i32
fn as_raw_socketlike(&self) -> i32
Returns the raw value.
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