Skip to main content

Crate rtcom_core

Crate rtcom_core 

Source
Expand description

Core library for rtcom — Rust Terminal Communication.

At v0.1 this crate provides:

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::ModemLineSnapshot;
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::LineEndingConfig;
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 serialport backend.
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 SerialDevice with the EventBus.