[−][src]Struct tokio_seqpacket::UnixSeqpacket
Unix seqpacket socket.
Note that there are no functions to get the local or remote address of the connection. That is because connected Unix sockets are always anonymous, which means that the address contains no useful information.
Implementations
impl UnixSeqpacket
[src]
pub async fn connect<P: AsRef<Path>>(address: P) -> Result<Self>
[src]
Connect a new seqpacket socket to the given address.
pub fn pair() -> Result<(Self, Self)>
[src]
Create a pair of connected seqpacket sockets.
pub unsafe fn from_raw_fd(fd: RawFd) -> Result<Self>
[src]
Wrap a raw file descriptor as UnixSeqpacket
.
Registration of the file descriptor with the tokio runtime may fail.
For that reason, this function returns a std::io::Result
.
Safety
This function is unsafe because the socket assumes it is the sole owner of the file descriptor. Usage of this function could accidentally allow violating this contract which can cause memory unsafety in code that relies on it being true.
pub fn as_raw_fd(&self) -> RawFd
[src]
Get the raw file descriptor of the socket.
pub fn into_raw_fd(self) -> RawFd
[src]
Deregister the socket from the tokio runtime and return the inner file descriptor.
pub fn peer_cred(&self) -> Result<UCred>
[src]
Get the effective credentials of the process which called connect
or pair
.
Note that this is not necessarily the process that currently has the file descriptor of the other side of the connection.
pub fn take_error(&self) -> Result<Option<Error>>
[src]
Get the value of the SO_ERROR
option.
pub fn poll_send(
&self,
cx: &mut Context<'_>,
buffer: &[u8]
) -> Poll<Result<usize>>
[src]
&self,
cx: &mut Context<'_>,
buffer: &[u8]
) -> Poll<Result<usize>>
Try to send data on the socket to the connected peer without blocking.
If the socket is not ready yet, the current task is scheduled to wake up when the socket becomes writeable.
Note that unlike Self::send
, only the last task calling this function will be woken up.
For that reason, it is preferable to use the async functions rather than polling functions when possible.
pub fn poll_send_vectored(
&self,
cx: &mut Context<'_>,
buffer: &[IoSlice<'_>]
) -> Poll<Result<usize>>
[src]
&self,
cx: &mut Context<'_>,
buffer: &[IoSlice<'_>]
) -> Poll<Result<usize>>
Try to send data on the socket to the connected peer without blocking.
If the socket is not ready yet, the current task is scheduled to wake up when the socket becomes writeable.
Note that unlike Self::send_vectored
, only the last task calling this function will be woken up.
For that reason, it is preferable to use the async functions rather than polling functions when possible.
pub fn poll_send_vectored_with_ancillary(
&self,
cx: &mut Context<'_>,
buffer: &[IoSlice<'_>],
ancillary: &mut SocketAncillary<'_>
) -> Poll<Result<usize>>
[src]
&self,
cx: &mut Context<'_>,
buffer: &[IoSlice<'_>],
ancillary: &mut SocketAncillary<'_>
) -> Poll<Result<usize>>
Try to send data with ancillary data on the socket to the connected peer without blocking.
If the socket is not ready yet, the current task is scheduled to wake up when the socket becomes writeable.
Note that unlike Self::send_vectored_with_ancillary
, only the last task calling this function will be woken up.
For that reason, it is preferable to use the async functions rather than polling functions when possible.
pub async fn send(&self, buffer: &[u8]) -> Result<usize>
[src]
Send data on the socket to the connected peer.
This function is safe to call concurrently from different tasks. Although no order is guaranteed, all calling tasks will try to complete the asynchronous action.
pub async fn send_vectored(&self, buffer: &[IoSlice<'_>]) -> Result<usize>
[src]
Send data on the socket to the connected peer.
This function is safe to call concurrently from different tasks. Although no order is guaranteed, all calling tasks will try to complete the asynchronous action.
pub async fn send_vectored_with_ancillary(
&self,
buffer: &[IoSlice<'_>],
ancillary: &mut SocketAncillary<'_>
) -> Result<usize>
[src]
&self,
buffer: &[IoSlice<'_>],
ancillary: &mut SocketAncillary<'_>
) -> Result<usize>
Send data with ancillary data on the socket to the connected peer.
This function is safe to call concurrently from different tasks. Although no order is guaranteed, all calling tasks will try to complete the asynchronous action.
pub fn poll_recv(
&self,
cx: &mut Context<'_>,
buffer: &mut [u8]
) -> Poll<Result<usize>>
[src]
&self,
cx: &mut Context<'_>,
buffer: &mut [u8]
) -> Poll<Result<usize>>
Try to receive data on the socket from the connected peer without blocking.
If there is no data ready yet, the current task is scheduled to wake up when the socket becomes readable.
Note that unlike Self::recv
, only the last task calling this function will be woken up.
For that reason, it is preferable to use the async functions rather than polling functions when possible.
pub fn poll_recv_vectored(
&self,
cx: &mut Context<'_>,
buffer: &mut [IoSliceMut<'_>]
) -> Poll<Result<usize>>
[src]
&self,
cx: &mut Context<'_>,
buffer: &mut [IoSliceMut<'_>]
) -> Poll<Result<usize>>
Try to receive data on the socket from the connected peer without blocking.
If there is no data ready yet, the current task is scheduled to wake up when the socket becomes readable.
Note that unlike Self::recv_vectored
, only the last task calling this function will be woken up.
For that reason, it is preferable to use the async functions rather than polling functions when possible.
pub fn poll_recv_vectored_with_ancillary(
&self,
cx: &mut Context<'_>,
buffer: &mut [IoSliceMut<'_>],
ancillary: &mut SocketAncillary<'_>
) -> Poll<Result<usize>>
[src]
&self,
cx: &mut Context<'_>,
buffer: &mut [IoSliceMut<'_>],
ancillary: &mut SocketAncillary<'_>
) -> Poll<Result<usize>>
Try to receive data with ancillary data on the socket from the connected peer without blocking.
If there is no data ready yet, the current task is scheduled to wake up when the socket becomes readable.
Note that unlike Self::recv_vectored_with_ancillary
, only the last task calling this function will be woken up.
For that reason, it is preferable to use the async functions rather than polling functions when possible.
pub async fn recv(&self, buffer: &mut [u8]) -> Result<usize>
[src]
Receive data on the socket from the connected peer.
This function is safe to call concurrently from different tasks. Although no order is guaranteed, all calling tasks will try to complete the asynchronous action.
pub async fn recv_vectored(
&self,
buffer: &mut [IoSliceMut<'_>]
) -> Result<usize>
[src]
&self,
buffer: &mut [IoSliceMut<'_>]
) -> Result<usize>
Receive data on the socket from the connected peer.
This function is safe to call concurrently from different tasks. Although no order is guaranteed, all calling tasks will try to complete the asynchronous action.
pub async fn recv_vectored_with_ancillary(
&self,
buffer: &mut [IoSliceMut<'_>],
ancillary: &mut SocketAncillary<'_>
) -> Result<usize>
[src]
&self,
buffer: &mut [IoSliceMut<'_>],
ancillary: &mut SocketAncillary<'_>
) -> Result<usize>
Receive data with ancillary data on the socket from the connected peer.
This function is safe to call concurrently from different tasks. Although no order is guaranteed, all calling tasks will try to complete the asynchronous action.
pub fn shutdown(&self, how: Shutdown) -> Result<()>
[src]
Shuts down the read, write, or both halves of this connection.
This function will cause all pending and future I/O calls on the
specified portions to immediately return with an appropriate value
(see the documentation of Shutdown
).
Trait Implementations
impl AsRawFd for UnixSeqpacket
[src]
impl Debug for UnixSeqpacket
[src]
impl IntoRawFd for UnixSeqpacket
[src]
fn into_raw_fd(self) -> RawFd
[src]
Auto Trait Implementations
impl !RefUnwindSafe for UnixSeqpacket
[src]
impl Send for UnixSeqpacket
[src]
impl Sync for UnixSeqpacket
[src]
impl Unpin for UnixSeqpacket
[src]
impl !UnwindSafe for UnixSeqpacket
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,