Struct arta_async_std::net::AsyncStdUdpSocket

source ·
pub struct AsyncStdUdpSocket { /* private fields */ }
Expand description

Async-std specific RuntimeUdpSocket implementation.

Trait Implementations§

source§

impl AsFd for AsyncStdUdpSocket

source§

fn as_fd(&self) -> BorrowedFd<'_>

Borrows the file descriptor. Read more
source§

impl AsRawFd for AsyncStdUdpSocket

source§

fn as_raw_fd(&self) -> RawFd

Extracts the raw file descriptor. Read more
source§

impl From<OwnedFd> for AsyncStdUdpSocket

source§

fn from(fd: OwnedFd) -> Self

Converts to this type from the input type.
source§

impl RuntimeUdpSocket for AsyncStdUdpSocket

§

type Runtime = AsyncStdGlobalRuntime

An async runtime.
source§

fn bind( runtime: &Self::Runtime, addrs: impl ToSocketAddrs<Self::Runtime>, ) -> impl Future<Output = Result<Self>> + Send
where Self: Sized,

Creates a UDP socket from the given address. Read more
source§

fn connect( &self, addrs: impl ToSocketAddrs<Self::Runtime>, ) -> impl Future<Output = Result<()>> + Send

Connects this UDP socket to a remote address, allowing the send and recv syscalls to be used to send data and also applies filters to only receive data from the specified address. Read more
source§

fn send(&self, buf: &[u8]) -> impl Future<Output = Result<usize>> + Send

Sends data on the socket to the remote address to which it is connected. On success, returns the number of bytes written. Read more
source§

async fn send_to( &self, buf: &[u8], addrs: impl ToSocketAddrs<Self::Runtime>, ) -> Result<usize>

Sends data on the socket to the given address. On success, returns the number of bytes written. Read more
source§

fn recv(&self, buf: &mut [u8]) -> impl Future<Output = Result<usize>> + Send

Receives a single datagram message on the socket from the remote address to which it is connected. On success, returns the number of bytes read. Read more
source§

fn recv_from( &self, buf: &mut [u8], ) -> impl Future<Output = Result<(usize, SocketAddr)>> + Send

Receives a single datagram message on the socket. On success, returns the number of bytes read and the origin. Read more
source§

fn local_addr(&self) -> Result<SocketAddr>

Returns the socket address that this socket was created from.
source§

fn set_broadcast(&self, is_enabled: bool) -> Result<()>

Sets the value of the SO_BROADCAST option for this socket.
source§

fn broadcast(&self) -> Result<bool>

Gets the value of the SO_BROADCAST option for this socket. Read more
source§

fn join_multicast_v4( &self, multiaddr: Ipv4Addr, interface: Ipv4Addr, ) -> Result<()>

Executes an operation of the IP_ADD_MEMBERSHIP type.
source§

fn leave_multicast_v4( &self, multiaddr: Ipv4Addr, interface: Ipv4Addr, ) -> Result<()>

Executes an operation of the IP_DROP_MEMBERSHIP type.
source§

fn set_multicast_loop_v4(&self, is_enabled: bool) -> Result<()>

Sets the value of the IP_MULTICAST_LOOP option for this socket.
source§

fn multicast_loop_v4(&self) -> Result<bool>

Gets the value of the IP_MULTICAST_LOOP option for this socket.
source§

fn set_multicast_ttl_v4(&self, ttl: u32) -> Result<()>

Sets the value of the IP_MULTICAST_TTL option for this socket.
source§

fn multicast_ttl_v4(&self) -> Result<u32>

Gets the value of the IP_MULTICAST_TTL option for this socket.
source§

fn join_multicast_v6(&self, multiaddr: Ipv6Addr, interface: u32) -> Result<()>

Executes an operation of the IPV6_ADD_MEMBERSHIP type.
source§

fn leave_multicast_v6(&self, multiaddr: Ipv6Addr, interface: u32) -> Result<()>

Executes an operation of the IPV6_DROP_MEMBERSHIP type.
source§

fn set_multicast_loop_v6(&self, is_enabled: bool) -> Result<()>

Sets the value of the IPV6_MULTICAST_LOOP option for this socket.
source§

fn multicast_loop_v6(&self) -> Result<bool>

Gets the value of the IPV6_MULTICAST_LOOP option for this socket.
source§

fn ttl(&self) -> Result<u32>

Gets the value of the IP_TTL option for this socket.
source§

fn set_ttl(&self, ttl: u32) -> Result<()>

Sets the value for the IP_TTL option on this socket. Read more
source§

fn take_error(&self) -> Result<Option<Error>>

Gets the value of the SO_ERROR option on this socket.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> AsFilelike for T
where T: AsFd,

source§

fn as_filelike(&self) -> BorrowedFd<'_>

Borrows the reference. Read more
source§

fn as_filelike_view<Target>(&self) -> FilelikeView<'_, Target>
where Target: FilelikeViewType,

Return a borrowing view of a resource which dereferences to a &Target. Read more
source§

impl<T> AsRawFilelike for T
where T: AsRawFd,

source§

fn as_raw_filelike(&self) -> i32

Returns the raw value.
source§

impl<T> AsRawSocketlike for T
where T: AsRawFd,

source§

fn as_raw_socketlike(&self) -> i32

Returns the raw value.
source§

impl<T> AsSocketlike for T
where T: AsFd,

source§

fn as_socketlike(&self) -> BorrowedFd<'_>

Borrows the reference.
source§

fn as_socketlike_view<Target>(&self) -> SocketlikeView<'_, Target>
where Target: SocketlikeViewType,

Return a borrowing view of a resource which dereferences to a &Target. Read more
source§

impl<T> AsSource for T
where T: AsFd,

source§

fn source(&self) -> BorrowedFd<'_>

Returns the borrowed file descriptor.
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> FromFd for T
where T: From<OwnedFd>,

source§

fn from_fd(owned_fd: OwnedFd) -> T

👎Deprecated since 1.0.0: FromFd::from_fd is replaced by From<OwnedFd>::from
Constructs a new instance of Self from the given file descriptor. Read more
source§

fn from_into_fd<Owned>(into_owned: Owned) -> Self
where Owned: Into<OwnedFd>, Self: Sized + From<OwnedFd>,

Constructs a new instance of Self from the given file descriptor converted from into_owned. Read more
source§

impl<T> FromFilelike for T
where T: From<OwnedFd>,

source§

fn from_filelike(owned: OwnedFd) -> T

Constructs a new instance of Self from the given filelike object. Read more
source§

fn from_into_filelike<Owned>(owned: Owned) -> T
where Owned: IntoFilelike,

Constructs a new instance of Self from the given filelike object converted from into_owned. Read more
source§

impl<T> FromSocketlike for T
where T: From<OwnedFd>,

source§

fn from_socketlike(owned: OwnedFd) -> T

Constructs a new instance of Self from the given socketlike object.
source§

fn from_into_socketlike<Owned>(owned: Owned) -> T
where Owned: IntoSocketlike,

Constructs a new instance of Self from the given socketlike object converted from into_owned.
source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

impl<T> FromOsOnwedDescriptor for T
where T: From<OwnedFd>,

source§

impl<T> OsFile for T
where T: AsRawFd + AsFd,

source§

impl<T> OsSocket for T
where T: AsRawFd + AsFd + From<OwnedFd>,