Trait embedded_nal_async::UdpFullStack
source · [−]pub trait UdpFullStack: UdpClientStack {
type BindFuture<'m>: Future<Output = Result<(), Self::Error>> + 'm
where
Self: 'm;
type SendToFuture<'m>: Future<Output = Result<(), Self::Error>> + 'm
where
Self: 'm;
fn bind<'m>(
&'m mut self,
socket: &'m mut Self::UdpSocket,
local_port: u16
) -> Self::BindFuture<'m>;
fn send_to<'m>(
&'m mut self,
socket: &'m mut Self::UdpSocket,
remote: SocketAddr,
buffer: &'m [u8]
) -> Self::SendToFuture<'m>;
}Expand description
This trait is implemented by UDP/IP stacks. It provides the ability to listen for packets on a specified port and send replies.
Required Associated Types
Future returned by bind function.
Required Methods
fn bind<'m>(
&'m mut self,
socket: &'m mut Self::UdpSocket,
local_port: u16
) -> Self::BindFuture<'m>
fn bind<'m>(
&'m mut self,
socket: &'m mut Self::UdpSocket,
local_port: u16
) -> Self::BindFuture<'m>
Bind a UDP socket with a specified port
fn send_to<'m>(
&'m mut self,
socket: &'m mut Self::UdpSocket,
remote: SocketAddr,
buffer: &'m [u8]
) -> Self::SendToFuture<'m>
fn send_to<'m>(
&'m mut self,
socket: &'m mut Self::UdpSocket,
remote: SocketAddr,
buffer: &'m [u8]
) -> Self::SendToFuture<'m>
Send a packet to a remote host/port.