1#![forbid(unsafe_op_in_unsafe_fn)]
2
3mod io_slice {
4 cfg_if::cfg_if! {
5 if #[cfg(any(target_family = "unix", target_os = "hermit", target_os = "solid_asp3", target_os = "trusty"))] {
6 mod iovec;
7 pub use iovec::*;
8 } else if #[cfg(target_os = "windows")] {
9 mod windows;
10 pub use windows::*;
11 } else if #[cfg(target_os = "wasi")] {
12 mod wasi;
13 pub use wasi::*;
14 } else if #[cfg(target_os = "uefi")] {
15 mod uefi;
16 pub use uefi::*;
17 } else {
18 mod unsupported;
19 pub use unsupported::*;
20 }
21 }
22}
23
24mod is_terminal {
25 cfg_if::cfg_if! {
26 if #[cfg(any(target_family = "unix", target_os = "wasi"))] {
27 mod isatty;
28 pub use isatty::*;
29 } else if #[cfg(target_os = "windows")] {
30 mod windows;
31 pub use windows::*;
32 } else if #[cfg(target_os = "hermit")] {
33 mod hermit;
34 pub use hermit::*;
35 } else {
36 mod unsupported;
37 pub use unsupported::*;
38 }
39 }
40}
41
42pub use io_slice::{IoSlice, IoSliceMut};
43pub use is_terminal::is_terminal;
44
45pub const DEFAULT_BUF_SIZE: usize = if cfg!(target_os = "espidf") { 512 } else { 8 * 1024 };