Expand description
Core library for rtcom — Rust Terminal Communication.
At v0.1 this crate provides:
SerialDevice— async serial-port abstraction (Issue #2).SerialPortDevice— default backend built ontokio_serial.SerialConfigand companion enums — the framing and flow parameters.EventandEventBus— cross-task event hub (Issue #5).Session— the orchestrator that drives serial I/O against the bus.Error/Result— the crate-wide error type.
Later issues layer the event bus, session orchestrator, mappers, and
command state machine on top of this foundation. See CLAUDE.md §7 for
the full v0.1 plan.
§Example
use rtcom_core::{SerialConfig, SerialDevice, SerialPortDevice};
use tokio::io::AsyncWriteExt;
let mut port = SerialPortDevice::open("/dev/ttyUSB0", SerialConfig::default())?;
port.write_all(b"hello\r\n").await?;Re-exports§
pub use command::Command;pub use command::CommandKeyParser;pub use command::ParseOutput;pub use config::DataBits;pub use config::FlowControl;pub use config::ModemStatus;pub use config::Parity;pub use config::SerialConfig;pub use config::StopBits;pub use config::DEFAULT_READ_TIMEOUT;pub use device::SerialDevice;pub use device::SerialPortDevice;pub use error::Error;pub use error::Result;pub use event::Event;pub use event::EventBus;pub use event::DEFAULT_BUS_CAPACITY;pub use lock::UucpLock;pub use mapper::LineEnding;pub use mapper::LineEndingMapper;pub use mapper::Mapper;pub use session::Session;
Modules§
- command
- Runtime commands and the keyboard state machine that produces them.
- config
- Serial line configuration and modem-status types.
- device
- Asynchronous serial device abstraction and default
serialportbackend. - error
- Error types for
rtcom-core. - event
- Cross-task event bus for
rtcom-core. - lock
- UUCP-style lock files.
- mapper
- Byte-stream mappers (CR/LF normalisation, future telnet/escape decoders, …).
- session
- Session orchestrator: bridges a
SerialDevicewith theEventBus.