kioto_serial/lib.rs
1//! Provide serial port I/O using tokio.
2//!
3//! This crate provides an interface very similar to
4//! [`tokio-serial`](https://crates.io/crates/tokio-serial) with a different
5//! implementation. Ideally, it can serve as a drop-in replacement.
6//!
7//! Except on Windows (see below), the implementation uses synchronous blocking
8//! I/O to the serial port and then wraps these with asynchronous channels.
9//!
10//! In Windows, `tokio-serial` is re-rexported because the approach used here,
11//! cloning the serial port handle, simply does not work. Specifically, a
12//! blocking read from the port blocks writing.
13#![deny(missing_docs)]
14
15#[cfg(target_os = "windows")]
16pub use tokio_serial::*;
17
18#[cfg(not(target_os = "windows"))]
19mod posix;
20
21#[cfg(not(target_os = "windows"))]
22pub use posix::*;