Skip to main content

ax_io/
lib.rs

1#![doc = include_str!("../README.md")]
2#![cfg_attr(not(doc), no_std)]
3#![feature(core_io)]
4#![feature(core_io_borrowed_buf)]
5#![feature(borrowed_buf_init)]
6#![feature(maybe_uninit_fill)]
7#![feature(min_specialization)]
8#![warn(missing_docs)]
9
10#[cfg(feature = "alloc")]
11extern crate alloc;
12
13#[cfg(all(axtest, feature = "axtest"))]
14/// Coverage tests for I/O traits and adapters.
15pub mod axtest;
16
17#[doc(no_inline)]
18pub use ax_errno::{AxError as Error, AxErrorKind as ErrorKind, AxResult as Result};
19
20/// Default buffer size for I/O operations.
21pub const DEFAULT_BUF_SIZE: usize = 1024 * 2;
22
23mod buffered;
24mod iobuf;
25pub mod prelude;
26mod read;
27mod seek;
28mod utils;
29mod write;
30
31pub use self::{buffered::*, iobuf::*, read::*, seek::*, utils::*, write::*};
32
33/// I/O poll results.
34#[derive(Debug, Default, Clone, Copy)]
35pub struct PollState {
36    /// Object can be read now.
37    pub readable: bool,
38    /// Object can be writen now.
39    pub writable: bool,
40    /// Monotonic token changed when the object's readiness may have changed.
41    pub readiness_version: u64,
42}