1#![doc = include_str!("../README.md")]
2#![cfg_attr(not(feature = "std"), no_std)]
3#![deny(warnings, missing_docs)]
4#![cfg_attr(docsrs, feature(doc_cfg))]
5#![cfg_attr(docsrs, allow(unused_attributes))]
6#![allow(clippy::needless_return)]
7#![allow(unreachable_code)]
8
9#[cfg(all(feature = "alloc", not(feature = "std")))]
10extern crate alloc as std;
11
12#[cfg(feature = "std")]
13extern crate std;
14
15pub use runtime::*;
16
17mod runtime {
19 pub use agnostic_lite::{
20 AfterHandle, AfterHandleError, AsyncAfterSpawner, AsyncBlockingSpawner, AsyncLocalSpawner,
21 AsyncSpawner, JoinHandle, LocalJoinHandle, RuntimeLite, Yielder, cfg_linux, cfg_smol,
22 cfg_tokio, cfg_unix, cfg_windows, time,
23 };
24
25 pub trait Runtime: RuntimeLite {
27 #[cfg(feature = "net")]
29 #[cfg_attr(docsrs, doc(cfg(feature = "net")))]
30 type Net: super::net::Net;
31
32 #[cfg(feature = "process")]
34 #[cfg_attr(docsrs, doc(cfg(feature = "process")))]
35 type Process: super::process::Process;
36
37 #[cfg(feature = "quinn")]
39 #[cfg_attr(docsrs, doc(cfg(feature = "quinn")))]
40 type Quinn: super::quinn::QuinnRuntime;
41
42 #[cfg(feature = "quinn")]
44 #[cfg_attr(docsrs, doc(cfg(feature = "quinn")))]
45 fn quinn() -> Self::Quinn;
46 }
47}
48
49pub use agnostic_io as io;
51
52#[cfg(feature = "tokio")]
56#[cfg_attr(docsrs, doc(cfg(feature = "tokio")))]
57pub mod tokio;
58
59#[cfg(feature = "smol")]
63#[cfg_attr(docsrs, doc(cfg(feature = "smol")))]
64pub mod smol;
65
66#[cfg(feature = "net")]
68#[cfg_attr(docsrs, doc(cfg(feature = "net")))]
69pub mod net;
70
71#[cfg(feature = "dns")]
73#[cfg_attr(docsrs, doc(cfg(feature = "dns")))]
74pub mod dns {
75 pub use agnostic_dns::{
76 AgnosticTime, AsyncConnectionProvider, AsyncDnsUdp, AsyncRuntimeProvider, AsyncSpawn,
77 CLOUDFLARE_IPS, Dns, GOOGLE_IPS, LookupIpStrategy, NameServerConfig, NameServerConfigGroup,
78 Protocol, QUAD9_IPS, ResolverConfig, ResolverOpts, ServerOrderingStrategy, Timer,
79 read_system_conf,
80 };
81
82 #[cfg(feature = "dns-over-rustls")]
83 #[cfg_attr(docsrs, doc(cfg(feature = "dns-over-rustls")))]
84 pub use agnostic_dns::TlsClientConfig;
85
86 #[cfg(unix)]
87 #[cfg_attr(docsrs, doc(cfg(unix)))]
88 pub use agnostic_dns::{parse_resolv_conf, read_resolv_conf};
89}
90
91#[cfg(feature = "quinn")]
93#[cfg_attr(docsrs, doc(cfg(feature = "quinn")))]
94pub mod quinn;
95
96#[cfg(feature = "process")]
98#[cfg_attr(docsrs, doc(cfg(feature = "process")))]
99pub mod process;