Enum mio_serial::BaudRate
[−]
[src]
pub enum BaudRate { Baud110, Baud300, Baud600, Baud1200, Baud2400, Baud4800, Baud9600, Baud14400, Baud19200, Baud38400, Baud57600, Baud115200, Baud128000, Baud256000, BaudOther(u32), }
Serial port baud rates.
Portability
The BaudRate
variants with numeric suffixes, e.g., Baud9600
, indicate standard baud rates
that are widely-supported on many systems. While non-standard baud rates can be set with
BaudOther
, their behavior is system-dependent. Some systems may not support arbitrary baud
rates. Using the standard baud rates is more likely to result in portable applications.
Variants
Baud110
110 baud.
Baud300
300 baud.
Baud600
600 baud.
Baud1200
1200 baud.
Baud2400
2400 baud.
Baud4800
4800 baud.
Baud9600
9600 baud.
Baud14400
14,400 baud.
Baud19200
19,200 baud.
Baud38400
38,400 baud.
Baud57600
57,600 baud.
Baud115200
115,200 baud.
Baud128000
128,000 baud.
Baud256000
256,000 baud.
BaudOther(u32)
Non-standard baud rates.
BaudOther
can be used to set non-standard baud rates by setting its member to be the
desired baud rate.
BaudOther(4_000_000); // 4,000,000 baud
Non-standard baud rates may not be supported on all systems.
Methods
impl BaudRate
[src]
fn standard_rates() -> Vec<u32>
[src]
Returns all cross-platform baud rates
fn platform_rates() -> Vec<u32>
[src]
Returns all available baud rates for the current platform
Trait Implementations
impl Copy for BaudRate
[src]
impl Clone for BaudRate
[src]
impl Eq for BaudRate
[src]
impl From<u32> for BaudRate
[src]
fn from(speed: u32) -> BaudRate
[src]
Creates a BaudRate
for a particular speed.
This function can be used to select a BaudRate
variant from an integer containing the
desired baud rate.
Example
assert_eq!(BaudRate::Baud9600, BaudRate::from(9600)); assert_eq!(BaudRate::BaudOther(50000), BaudRate::from(50000)); assert_eq!(BaudRate::Baud9600, 9600u32.into()); assert_eq!(BaudRate::BaudOther(50000), 50000u32.into());