dust_mail/
runtime.rs

1pub mod io {
2
3    #[cfg(feature = "runtime-async-std")]
4    pub(crate) use async_std::io::{Read, Write};
5
6    #[cfg(feature = "runtime-tokio")]
7    pub(crate) use tokio::io::{
8        AsyncBufRead as BufRead, AsyncRead as Read, AsyncWrite as Write, BufStream,
9    };
10}
11
12pub mod time {
13    #[cfg(feature = "runtime-async-std")]
14    pub use async_std::task::sleep;
15    #[cfg(feature = "runtime-async-std")]
16    pub use std::time::{Duration, Instant};
17
18    #[cfg(feature = "runtime-tokio")]
19    pub use tokio::time::{sleep, Duration, Instant};
20}
21
22pub mod thread {
23    #[cfg(feature = "runtime-async-std")]
24    pub(crate) use async_std::{sync::RwLock, task::spawn};
25
26    #[cfg(feature = "runtime-tokio")]
27    pub(crate) use tokio::{sync::RwLock, task::spawn};
28}
29
30pub mod net {
31    #[cfg(feature = "runtime-async-std")]
32    pub(crate) use async_std::net::TcpStream;
33
34    #[cfg(feature = "runtime-tokio")]
35    pub(crate) use tokio::net::TcpStream;
36}
37
38#[cfg(feature = "runtime-async-std")]
39pub(crate) use async_std::task::JoinHandle;
40
41#[cfg(feature = "runtime-tokio")]
42pub(crate) use tokio::task::JoinHandle;