pub struct Settings { /* private fields */ }
Expand description
The settings of a serial port.
Implementations
sourceimpl Settings
impl Settings
sourcepub fn set_baud_rate(&mut self, baud_rate: u32) -> Result<()>
pub fn set_baud_rate(&mut self, baud_rate: u32) -> Result<()>
Set the baud rate to be configured.
This function returns an error if the platform does not support the requested band-width.
Note that the device itself may also not support the requested baud rate, even if the platform does.
In that case SerialPort::set_configuration()
will return an error.
sourcepub fn get_baud_rate(&self) -> Result<u32>
pub fn get_baud_rate(&self) -> Result<u32>
Get the baud rate from the configuration.
sourcepub fn set_char_size(&mut self, char_size: CharSize)
pub fn set_char_size(&mut self, char_size: CharSize)
Set the number of bits in a character.
sourcepub fn get_char_size(&self) -> Result<CharSize>
pub fn get_char_size(&self) -> Result<CharSize>
Get the number of bits in a character.
sourcepub fn set_stop_bits(&mut self, stop_bits: StopBits)
pub fn set_stop_bits(&mut self, stop_bits: StopBits)
Set the number of stop bits following each character.
sourcepub fn get_stop_bits(&self) -> Result<StopBits>
pub fn get_stop_bits(&self) -> Result<StopBits>
Get the number of stop bits following each character.
sourcepub fn set_parity(&mut self, parity: Parity)
pub fn set_parity(&mut self, parity: Parity)
Set the partity check.
sourcepub fn get_parity(&self) -> Result<Parity>
pub fn get_parity(&self) -> Result<Parity>
Get the partity check.
sourcepub fn set_flow_control(&mut self, flow_control: FlowControl)
pub fn set_flow_control(&mut self, flow_control: FlowControl)
Set the flow control mechanism.
See the individual documentation of the FlowControl
variants for more information.
sourcepub fn get_flow_control(&self) -> Result<FlowControl>
pub fn get_flow_control(&self) -> Result<FlowControl>
Get the flow control mechanism
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Settings
impl Send for Settings
impl Sync for Settings
impl Unpin for Settings
impl UnwindSafe for Settings
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more