serial2
Cross platform serial ports
0.2.38
8.9M downloads/mo
#3329 most downloaded on crates.io
de-vri-es/serial2-rs
What this package is like to depend on
Last release 23 days ago
31 Jul 2026
Ships fairly regularly
a new release about every 2 months
Nearly every release is documented
notes for 49 of 49 stable releases
3 versions withdrawn
withdrawn after publishing
5 years old
55 releases · first in 2021
7 releases in the last 12 months
see the full history below
Release timeline
55 releases · Nov 2021 to Jul 2026
2022
2023
2024
2025
2026
Releases
latest 55-
0.2.3831 Jul 2026Release notes
Open source →Changes:
- [fix][minor] Allow deserializing char size and stop bits from signed integers (as long as they are positive).
Release notes
Open source →- [fix][minor] Allow deserializing char size and stop bits from signed integers (as long as they are positive).
-
0.2.3711 May 2026Release notes
Open source →Changes:
- [change][minor] Switch from
winapitowindows_sysfor Windows platforms.
Release notes
Open source →- [change][minor] Switch from
winapitowindows-sysfor Windows platforms.
- [change][minor] Switch from
-
0.2.3613 Apr 2026Release notes
Open source →Changes:
- [fix][minor] Fix build on Haiku.
- [fix][minor] Fix
SerialPort::pair()on OpenBSD, Haiku and DragonFlyBSD.
Release notes
Open source →- [fix][minor] Fix build on Haiku.
- [fix][minor] Fix
SerialPort::pair()on OpenBSD, Haiku and DragonFlyBSD.
-
0.2.3504 Apr 2026Release notes
Open source →Changes:
- [add][minor] Include
tty0ttydevices inavailable_ports()on Linux.
- [add][minor] Include
-
0.2.3416 Feb 2026Release notes
Open source →Changes:
- [fix][minor] Make
SerialPort::pair()open the first PTY in non-blocking mode.
Release notes
Open source →- [fix][minor] Make
SerialPort::pair()open the first PTY in non-blocking mode.
- [fix][minor] Make
-
0.2.3322 Sep 2025 -
0.2.3212 Sep 2025 -
0.2.3107 Aug 2025 -
0.2.3031 Jul 2025Release notes
Open source →Changes:
- [fix][minor] Fix
SerialPort::discard_buffers()on Unix platforms.
- [fix][minor] Fix
-
0.2.2908 Apr 2025Release notes
Open source →Changes:
- [add][minor] Add
SerialPort::set_break()to hold the data line in break condition.
Release notes
Open source →- [add][minor] Add
SerialPort::set_break()to hold the data line in break condition.
- [add][minor] Add
-
0.2.2810 Nov 2024 -
0.2.2713 Sep 2024Release notes
Open source →- [fix][minor] Allow for a 2.5% deviation in actual baud rate when applying settings on Unix.
- [add][minor] Implement
DebugforSerialPortshowing the underlying file descriptor (Unix) or handle (Windows).
-
0.2.2621 Jun 2024 -
0.2.2513 Jun 2024 -
0.2.2423 Apr 2024 -
0.2.2323 Apr 2024Release notes
Open source →- [add][minor] Add a "doc" feature to enable all feature and platform specific items with stubs for documentation purposes.
-
0.2.2223 Apr 2024Release notes
Open source →- [add][minor] Add
SerialPort::set_rs4xx_mode()andget_rs4xx_mode()behindrs4xxfeature flag.
- [add][minor] Add
-
0.2.2115 Apr 2024Release notes
Open source →- [change][patch] Improve documentation about timeouts and composed operations like
read_exact()andwrite_all().
- [change][patch] Improve documentation about timeouts and composed operations like
-
0.2.2004 Mar 2024 -
0.2.1904 Feb 2024Release notes
Open source →- [add][minor] Add
SerialPort::pair()on Unix platforms to open a pair of connected pseudo-terminals.
- [add][minor] Add
-
0.2.1804 Feb 2024 -
0.2.1719 Jan 2024Release notes
Open source →- [fix][minor] Set the
IGNBRKandIGNPARflags inSettings::set_raw()on Unix platforms.
- [fix][minor] Set the
-
0.2.1608 Jan 2024Release notes
Open source →- [add][minor] Add
SerialPort::read_exact()that takes&self. - [fix][minor] Fix behavior of
SerialPort::write_all()when a write returnsOk(0). - [fix][minor] Fix behavior of
SerialPort::write_all()when a write is interrupted.
- [add][minor] Add
-
0.2.1527 Dec 2023 -
0.2.1416 Dec 2023 -
0.2.1316 Dec 2023Release notes
Open source →- [add][minor] Add
CharSize::as_u8(). - [add][minor] Add
StopBits::as_u8(). - [add][minor] Add
Parity::as_str()andParity::from_str(). - [add][minor] Add
FlowControl::as_str()and FlowControl::from_str()`. - [add][minor] Implement
DisplayforCharSize,StopBits,ParityandFlowControl. - [add][minor] Implement
TryFrom<...>forCharSizefor integer types. - [add][minor] Implement
TryFrom<...>forStopBitsfor integer types. - [add][minor] Implement
TryFrom<&str>forParity. - [add][minor] Implement
TryFrom<&str>forFlowControl.
- [add][minor] Add
-
0.2.1202 Dec 2023 -
0.2.1102 Dec 2023Release notes
Open source →- [change][patch] Add example for
SerialPort::open()for configuring the serial port with a closure.
- [change][patch] Add example for
-
0.2.1021 Nov 2023Release notes
Open source →- [change][patch] Tweak the documentation style for the optional
serdesupport.
- [change][patch] Tweak the documentation style for the optional
-
0.2.921 Nov 2023 -
0.2.803 Nov 2023Release notes
Open source →- [change][minor] Set
VMINto 1 on Unix platforms to work correctly withepoll()on Linux.
- [change][minor] Set
-
0.2.716 Oct 2023Release notes
Open source →- [add][minor] Add the
"unix"crate feature to enable Unix specific extensions. - [add][minor] Add the
"windows"crate feature to enable Windows specific extensions. - [add][minor] Add
Settings::as_raw_termios()andas_raw_termios_mut()on Unix platforms. - [add][minor] Add
Settings::as_raw_dcb()andas_raw_dcb_mut()on Windows. - [add][minor] Add
SerialPort::get_windows_timeouts()andset_windows_timeouts()on Windows.
- [add][minor] Add the
-
0.2.606 Oct 2023Release notes
Open source →- [fix][oatch] Remove wrong documentation about manually using the win32 device namespace on Windows.
-
0.2.506 Oct 2023Release notes
Open source →- [change][minor] Increase the default read/write timeouts on Unix platforms to 3 seconds.
- [fix][minor] Explicitly set
VMINandVTIMEto 0 on Unix platforms inSettings::set_raw(). - [fix][minor] Mimic Unix behavior on Windows: read will return with available data as soon as possible.
-
0.2.406 Oct 2023Release notes
Open source →- [change][patch] Always open serial ports with the
O_NONBLOCKflag on Unix.
- [change][patch] Always open serial ports with the
-
0.2.306 Oct 2023Release notes
Open source →- [add][minor] Implement
From<OwnedFd>,Into<OwnedFd>andAsFdforSerialPorton Unix platforms. - [add][minor] Implement
From<OwnedHandle>,Into<OwnedHandle>andAsHandleforSerialPorton Windows.
- [add][minor] Implement
-
0.2.204 Aug 2023 -
0.2.129 May 2023 -
0.2.028 May 2023Release notes
Open source →- [change][major] Do not implicitly set the serial port to raw mode when using a closure as second argument to
SerialPort::open(). - [add][minor] Add
Settings::set_raw()to disable OS level input/output processing.
- [change][major] Do not implicitly set the serial port to raw mode when using a closure as second argument to
-
0.1.1029 May 2023 -
0.1.928 May 2023Release notes
Open source →- [fix][minor] Disable
fDsrSensitivityon Windows when configuring flow control.
- [fix][minor] Disable
-
0.1.828 May 2023Release notes
Open source →- [change][patch] Mention the win32 device namespace in the documentation.
- [add][minor] Implement
DebugforSettings. - [fix][minor] Fix setting of character size, stop bits and parity on Unix platforms.
-
0.1.712 Oct 2022 -
0.1.609 Dec 2021Release notes
Open source →- [change][patch] Remove fills for libc constants that are no longer needed.
-
0.1.520 Nov 2021 -
0.1.419 Nov 2021Release notes
Open source →- [add][minor] Detect
/dev/ttyU*and/dev/cuaU*devices when listing serial ports on FreeBSD and DragonFlyBSD.
- [add][minor] Detect
-
0.1.313 Nov 2021Release notes
Open source →- [fix][minor] Handle non-existing
HKLM\Hardware\DEVICEMAP\SERIALregistry key for port enumeration on Windows.
- [fix][minor] Handle non-existing
-
0.1.213 Nov 2021 -
0.1.113 Nov 2021 -
0.1.012 Nov 2021 withdrawnRelease notes
Open source →- [add][minor] Add non-trait
is_read_vectored()andis_write_vectored()functions. - [change][patch] Improve documentation.
- [add][minor] Add non-trait
-
0.1.0-alpha511 Nov 2021 pre-releaseRelease notes
Open source →- [add][minor] Implement port enumeration for BSD and Apple platforms.
- [add][minor] Implement port enumeration for Illumos and Solaris.
-
0.1.0-alpha409 Nov 2021 pre-releaseRelease notes
Open source →- [fix][minor] Fix buffer truncation when enumerating ports on Windows.
- [add][minor] Switch to overlapped IO on windows to allow concurrent reads and writes.
-
0.1.0-alpha308 Nov 2021 pre-releaseRelease notes
Open source →- [add][minor] Implement port enumeration for Windows.
- [fix][minor] Fix comparing
termiosstruct on Linux, when usingBOTHERwith a standard baud rate. - [change][minor] Always set the TTY to raw mode on Unix.
- [add][minor] Add versions of
read(),write()and friends that take a const&self. - [add][minor] Make
KeepSettingspublic as intended. - [change][minor] Make more functions take
&selfinstead of&mut self.
-
0.1.0-alpha207 Nov 2021 pre-release withdrawnRelease notes
Open source →- [add][minor] Add
SerialPort::available_ports(), which for now only works on Linux.
- [add][minor] Add
-
0.1.0-alpha107 Nov 2021 pre-release withdrawn