ts_netstack_smoltcp_socket/
lib.rs1#![doc = include_str!("../README.md")]
2#![no_std]
3#![deny(unsafe_code)]
4
5extern crate alloc;
6
7#[cfg(feature = "std")]
8extern crate std;
9
10pub extern crate ts_netstack_smoltcp_core as netcore;
11
12#[doc(inline)]
13pub use netcore::smoltcp::wire::IpProtocol;
14
15macro_rules! socket_requestor_impl {
19 () => {
20 fn request_blocking(
21 &self,
22 command: impl Into<$crate::netcore::Command>,
23 ) -> Result<$crate::netcore::Response, $crate::netcore::ChannelClosedError> {
24 ::netcore::HasChannel::request_blocking(&self.sender, Some(self.handle), command)
25 }
26
27 async fn request(
28 &self,
29 command: impl Into<$crate::netcore::Command>,
30 ) -> Result<$crate::netcore::Response, $crate::netcore::Error> {
31 ::netcore::HasChannel::request(&self.sender, Some(self.handle), command).await
32 }
33 };
34}
35
36mod create_socket;
37pub use create_socket::CreateSocket;
38
39pub mod ping;
40mod raw;
41mod tcp;
42mod udp;
43
44pub use ping::PingError;
45#[cfg(feature = "tokio")]
46pub use ping::ping;
47pub use raw::RawSocket;
48pub use tcp::{TcpListener, TcpStream};
49pub use udp::UdpSocket;