atomr_remote_serial/lib.rs
1//! Serial / USB-attached transport for atomr-remoting.
2//!
3//! `atomr-remote-serial` implements [`atomr_remote::transport::Transport`]
4//! over a serial endpoint exposed by a USB CDC-ACM device — typically
5//! `/dev/ttyACM0` (Linux host), `/dev/ttyGS0` (Linux gadget side),
6//! `COMx` (Windows), or `/dev/cu.usbmodemXXXX` (macOS). The use case is
7//! two hosts physically connected by a USB cable that want to exchange
8//! actor messages without going over the network.
9//!
10//! ```no_run
11//! use std::sync::Arc;
12//! use atomr_remote::{RemoteSettings, RemoteSystem};
13//! use atomr_remote_serial::SerialTransport;
14//!
15//! # async fn run(system: atomr_core::actor::ActorSystem,
16//! # settings: RemoteSettings)
17//! # -> Result<(), Box<dyn std::error::Error>> {
18//! let transport = Arc::new(SerialTransport::new("SystemA", "/dev/ttyACM0"));
19//! let _remote = RemoteSystem::start_with_transport(system, transport, settings).await?;
20//! # Ok(())
21//! # }
22//! ```
23//!
24//! See `docs/remoting.md` for the wiring on the gadget side and the
25//! zero-code "USB-Ethernet" alternative (CDC-NCM + existing TCP transport).
26
27mod reconnect;
28mod transport;
29
30pub use reconnect::ReconnectPolicy;
31pub use transport::SerialTransport;