A cross-platform serial port library for Rust providing blocking I/O and port enumeration.
serialport-rs is a cross-platform serial port library for Rust that provides a blocking I/O interface and port enumeration capabilities. It solves the problem of interacting with serial hardware (like microcontrollers, sensors, and industrial devices) across different operating systems with a unified API. The library abstracts platform-specific details while still allowing access to native functionality when needed.
Rust developers working with embedded systems, IoT devices, robotics, or any hardware that communicates via serial ports. It's particularly useful for those who need cross-platform compatibility for their serial communication applications.
Developers choose serialport-rs because it offers a simple, consistent cross-platform API for serial communication in Rust, reducing the complexity of dealing with OS-specific serial port implementations. Its RAII-based design and builder pattern make it safe and ergonomic to use.
A cross-platform serial port library in Rust. Provides a blocking I/O interface and port enumeration including USB device information.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Supports Linux, macOS, Windows, FreeBSD, NetBSD, Android, and iOS with a unified API, enabling portable serial applications without platform-specific code.
Uses RAII to automatically close ports when objects are dropped, preventing resource leaks and simplifying cleanup in Rust's ownership model.
Offers a fluent builder pattern for setting baud rate, timeout, DTR control, and other port settings, making configuration ergonomic and readable.
Lists available serial ports and provides USB device information on most platforms via libudev integration, aiding in device discovery and management.
The library only provides blocking I/O; for asynchronous operations, developers must rely on separate crates like mio-serial or tokio-serial, adding complexity and fragmentation.
On Linux, full enumeration depends on libudev, requiring additional system packages (e.g., libudev-dev) and complicating deployment, especially in constrained environments.
The project is actively seeking maintainers, especially for Windows, which could lead to slower bug fixes, limited updates, and potential instability in critical areas.
Serial enumeration is unavailable on some platforms like Android and NetBSD, and macOS enumerates duplicate ports (/dev/cu.* and /dev/tty.*), which can confuse users and require extra handling.