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
13mod error;
14
15pub use error::{Error, ErrorKind, IoError, IoResult, Result};
16
17/// Default buffer size for I/O operations.
18pub const DEFAULT_BUF_SIZE: usize = 1024 * 2;
19
20mod buffered;
21mod iobuf;
22pub mod prelude;
23mod read;
24mod seek;
25mod utils;
26mod write;
27
28pub use self::{buffered::*, iobuf::*, read::*, seek::*, utils::*, write::*};
29
30/// I/O poll results.
31#[derive(Debug, Default, Clone, Copy)]
32pub struct PollState {
33    /// Object can be read now.
34    pub readable: bool,
35    /// Object can be writen now.
36    pub writable: bool,
37    /// Monotonic token changed when the object's read readiness may have
38    /// changed.
39    pub read_readiness_version: u64,
40    /// Monotonic token changed when the object's write readiness may have
41    /// changed.
42    pub write_readiness_version: u64,
43}