Problem
The new unstable SerialOutstation::open API is declared async:
pub async fn open(
self,
path: &str,
settings: SerialSettings,
) -> std::io::Result<SerialOutstationTask>
The implementation contains no await. It calls crate::serial::open, which calls the synchronous tokio_serial::SerialStream::open, and then constructs the task.
The async signature suggests that opening the port is performed asynchronously, and it requires callers to create and drive a future even though the operation completes synchronously.
Proposed change
Make open a synchronous method:
pub fn open(
self,
path: &str,
settings: SerialSettings,
) -> std::io::Result<SerialOutstationTask>
The API is currently behind the unstable feature, so this is a good time to correct the signature before stabilization.
Problem
The new unstable
SerialOutstation::openAPI is declared async:The implementation contains no await. It calls
crate::serial::open, which calls the synchronoustokio_serial::SerialStream::open, and then constructs the task.The async signature suggests that opening the port is performed asynchronously, and it requires callers to create and drive a future even though the operation completes synchronously.
Proposed change
Make
opena synchronous method:The API is currently behind the
unstablefeature, so this is a good time to correct the signature before stabilization.