embedded_nal

Trait UdpFullStack

Source
pub trait UdpFullStack: UdpClientStack {
    // Required methods
    fn bind(
        &mut self,
        socket: &mut Self::UdpSocket,
        local_port: u16,
    ) -> Result<(), Self::Error>;
    fn send_to(
        &mut self,
        socket: &mut Self::UdpSocket,
        remote: SocketAddr,
        buffer: &[u8],
    ) -> Result<(), Self::Error>;
}
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 Methods§

Source

fn bind( &mut self, socket: &mut Self::UdpSocket, local_port: u16, ) -> Result<(), Self::Error>

Bind a UDP socket with a specified port

Source

fn send_to( &mut self, socket: &mut Self::UdpSocket, remote: SocketAddr, buffer: &[u8], ) -> Result<(), Self::Error>

Send a packet to a remote host/port.

Implementations on Foreign Types§

Source§

impl<T: UdpFullStack> UdpFullStack for &mut T

Source§

fn bind( &mut self, socket: &mut Self::UdpSocket, local_port: u16, ) -> Result<(), Self::Error>

Source§

fn send_to( &mut self, socket: &mut Self::UdpSocket, remote: SocketAddr, buffer: &[u8], ) -> Result<(), Self::Error>

Implementors§

Source§

impl<'a, T> UdpFullStack for SharedStack<'a, T>
where T: UdpFullStack,