1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
//! An efficient runtime for asynchronous applications.
//!
//! There are two implementations of this runtime:
//! - The [`photonio-uring`][photonio-uring] crate provides an implementation
//! for Linux based on [`io_uring`][io_uring].
//! - The [`photonio-tokio`][photonio-tokio] crate provides an implementation
//! for other platforms based on [`tokio`][tokio].
//!
//! By default, this crate uses the `photonio-uring` implementation on Linux and
//! the `photonio-tokio` implementation on other platforms. To use the
//! `photonio-tokio` implementation on all platforms, enable the `tokio`
//! feature.
//!
//! [photonio-uring]: https://docs.rs/photonio-uring
//! [photonio-tokio]: https://docs.rs/photonio-tokio
//! [io_uring]: https://unixism.net/loti/
//! [tokio]: https://docs.rs/tokio
//!
//! ## Examples
//!
//! ```no_run
//! use photonio::{
//! fs::File,
//! io::{Write, WriteAt},
//! };
//!
//! #[photonio::main]
//! async fn main() -> std::io::Result<()> {
//! let mut file = File::create("hello.txt").await?;
//! file.write(b"hello").await?;
//! file.write_at(b"world", 5).await?;
//! Ok(())
//! }
//! ```
//!
//! ## Limitations
//!
//! - Dropping an unfinished future for asynchronous filesystem or networking
//! operations will result in a panic. However, this behavior might be change
//! in the future.
//! - The current multi-thread runtime uses a naive round-robin fashion to
//! schedule tasks. A work-stealing scheduler will be added in the future.
pub use ;
pub use *;
pub use *;