Trait serial2::IntoSettings

source ·
pub trait IntoSettings {
    // Required method
    fn apply_to_settings(self, settings: &mut Settings) -> Result<()>;
}
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.

Required Methods§

source

fn apply_to_settings(self, settings: &mut Settings) -> Result<()>

Apply the configuration to an existing Settings struct.

Implementations on Foreign Types§

source§

impl IntoSettings for u32

source§

fn apply_to_settings(self, settings: &mut Settings) -> Result<()>

Implementors§