Skip to main content

arcbox_virtio_console/
lib.rs

1//! `VirtIO` console device (virtio-console).
2//!
3//! Implements the `VirtIO` console device for serial I/O.
4//!
5//! Supports multiple console backends:
6//! - Standard I/O (stdin/stdout)
7//! - Buffer-based (for testing)
8//! - PTY (pseudo-terminal) for real terminal emulation
9//! - Socket-based for network console
10//!
11//! ## Module layout
12//!
13//! - `io`: `ConsoleIo` trait + in-process backends (`StdioConsole`, `BufferConsole`)
14//! - `pty`: PTY backend (Unix only)
15//! - `socket`: Unix-socket backend (Unix only)
16//! - `device`: `VirtioConsole` device + `VirtioDevice` impl
17
18#![allow(clippy::ptr_as_ptr)]
19#![allow(clippy::borrow_as_ptr)]
20#![allow(clippy::unnecessary_cast)]
21#![allow(clippy::cognitive_complexity)]
22#![allow(clippy::map_unwrap_or)]
23#![allow(clippy::useless_vec)]
24#![allow(clippy::unnecessary_wraps)]
25#![allow(clippy::redundant_clone)]
26#![allow(clippy::unnecessary_map_or)]
27#![allow(clippy::missing_fields_in_debug)]
28#![allow(clippy::needless_lifetimes)]
29#![allow(clippy::needless_collect)]
30#![allow(mismatched_lifetime_syntaxes)]
31
32mod device;
33mod io;
34#[cfg(unix)]
35mod pty;
36#[cfg(unix)]
37mod socket;
38
39pub use device::{ConsoleConfig, VirtioConsole};
40pub use io::{BufferConsole, ConsoleIo, StdioConsole};
41#[cfg(unix)]
42pub use pty::PtyConsole;
43#[cfg(unix)]
44pub use socket::SocketConsole;