#[cfg(not(feature = "metal-io"))]
use crate::{Capabilities, RecvMeta, Transmit};
#[cfg(not(feature = "metal-io"))]
use std::{
fmt::Debug,
io::{self, IoSliceMut},
net::SocketAddr,
task::{Context, Poll},
};
#[cfg(feature = "runtime-smol")]
mod smol;
#[cfg(feature = "runtime-smol")]
pub use self::smol::UdpSocket;
#[cfg(feature = "runtime-async-std")]
mod async_std;
#[cfg(feature = "runtime-async-std")]
pub use self::async_std::UdpSocket;
#[cfg(feature = "runtime-tokio")]
mod tokio;
#[cfg(feature = "runtime-tokio")]
pub use self::tokio::UdpSocket;
#[cfg(feature = "metal-io")]
mod metal_io;
#[cfg(feature = "metal-io")]
pub use self::metal_io::UdpSocket;
#[cfg(not(feature = "metal-io"))]
pub trait AsyncUdpSocket: Send + Debug + 'static {
fn poll_send(
&self,
cx: &mut Context<'_>,
capabilities: &Capabilities,
transmits: &[Transmit],
) -> Poll<Result<usize, io::Error>>;
fn poll_recv(
&self,
cx: &mut Context<'_>,
bufs: &mut [IoSliceMut<'_>],
meta: &mut [RecvMeta],
) -> Poll<io::Result<usize>>;
fn local_addr(&self) -> io::Result<SocketAddr>;
fn peer_addr(&self) -> io::Result<SocketAddr>;
}