Trait serial2_tokio::IntoSettings
source · pub trait IntoSettings {
// Required method
fn apply_to_settings(self, settings: &mut Settings) -> Result<(), Error>;
}
Expand description
Trait for objects that can configure a serial port.
The simplest option is to pass a u32
, which is used to set the baud rate of the port.
That will also disable all OS level input and output modification,
configure a character size of 8 bits with 1 stop bit,
and it disables paritity checks and flow control.
For more control, it is possible to pass a Fn(Settings) -> std::io::Result<Settings>
.
If you do, you will generally want to start with a call to Settings::set_raw()
.
To open a serial port without modifying any settings, pass KeepSettings
.