[−][src]Struct cap_async_std::os::unix::net::UnixDatagram
A Unix datagram socket.
This corresponds to std::os::unix::net::UnixDatagram
.
Note that this UnixDatagram
has no bind
, connect
, or send_to
methods. To create a UnixDatagram
,
you must first obtain a Dir
containing the path, and then call
Dir::bind_unix_datagram
, Dir::connect_unix_datagram
, or
Dir::send_to_unix_datagram_addr
.
Implementations
impl UnixDatagram
[src]
pub fn from_std(std: UnixDatagram) -> Self
[src]
Constructs a new instance of Self
from the given async_std::os::unix::net::UnixDatagram
.
pub fn unbound() -> Result<Self>
[src]
Creates a Unix Datagram socket which is not bound to any address.
This corresponds to std::os::unix::net::UnixDatagram::unbound
.
TODO: should this require a capability?
pub fn pair() -> Result<(Self, Self)>
[src]
Creates an unnamed pair of connected sockets.
This corresponds to std::os::unix::net::UnixDatagram::pair
.
TODO: should this require a capability?
pub fn local_addr(&self) -> Result<SocketAddr>
[src]
Returns the address of this socket.
This corresponds to std::os::unix::net::UnixDatagram::local_addr
.
pub fn peer_addr(&self) -> Result<SocketAddr>
[src]
Returns the address of this socket's peer.
This corresponds to std::os::unix::net::UnixDatagram::peer_addr
.
pub async fn recv_from<'_, '_>(
&'_ self,
buf: &'_ mut [u8]
) -> Result<(usize, SocketAddr)>
[src]
&'_ self,
buf: &'_ mut [u8]
) -> Result<(usize, SocketAddr)>
Receives data from the socket.
This corresponds to std::os::unix::net::UnixDatagram::recv_from
.
pub async fn recv<'_, '_>(&'_ self, buf: &'_ mut [u8]) -> Result<usize>
[src]
Receives data from the socket.
This corresponds to std::os::unix::net::UnixDatagram::recv
.
pub async fn send<'_, '_>(&'_ self, buf: &'_ [u8]) -> Result<usize>
[src]
Sends data on the socket to the socket's peer.
This corresponds to std::os::unix::net::UnixDatagram::send
.
pub fn shutdown(&self, how: Shutdown) -> Result<()>
[src]
Shut down the read, write, or both halves of this connection.
This corresponds to std::os::unix::net::UnixDatagram::shutdown
.
Trait Implementations
impl AsRawFd for UnixDatagram
[src]
impl FromRawFd for UnixDatagram
[src]
unsafe fn from_raw_fd(fd: RawFd) -> Self
[src]
impl IntoRawFd for UnixDatagram
[src]
fn into_raw_fd(self) -> RawFd
[src]
Auto Trait Implementations
impl RefUnwindSafe for UnixDatagram
impl Send for UnixDatagram
impl Sync for UnixDatagram
impl Unpin for UnixDatagram
impl UnwindSafe for UnixDatagram
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,
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.
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>,