[−]Enum novatel_oem6_api::BaudRate
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.
Baud19200
19,200 baud.
Baud38400
38,400 baud.
Baud57600
57,600 baud.
Baud115200
115,200 baud.
BaudOther(usize)
Non-standard baud rates.
BaudOther
can be used to set non-standard baud rates by setting its member to be the
desired baud rate.
serial_core::BaudOther(4_000_000); // 4,000,000 baud
Non-standard baud rates may not be supported on all systems.
Methods
impl BaudRate
impl BaudRate
pub fn from_speed(speed: usize) -> BaudRate
pub fn from_speed(speed: usize) -> BaudRate
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_speed(9600)); assert_eq!(BaudRate::Baud115200, BaudRate::from_speed(115200)); assert_eq!(BaudRate::BaudOther(4000000), BaudRate::from_speed(4000000));
pub fn speed(&self) -> usize
pub fn speed(&self) -> usize
Returns the baud rate as an integer.
Example
assert_eq!(9600, BaudRate::Baud9600.speed()); assert_eq!(115200, BaudRate::Baud115200.speed()); assert_eq!(4000000, BaudRate::BaudOther(4000000).speed());
Trait Implementations
impl Debug for BaudRate
impl Debug for BaudRate
impl Eq for BaudRate
impl Eq for BaudRate
impl PartialEq<BaudRate> for BaudRate
impl PartialEq<BaudRate> for BaudRate
impl Clone for BaudRate
impl Clone for BaudRate
fn clone(&self) -> BaudRate
fn clone(&self) -> BaudRate
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl Copy for BaudRate
impl Copy for BaudRate
Auto Trait Implementations
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
impl<T, U> Into for T where
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
impl<T> From for T
[src]
impl<T> From for T
impl<T, U> TryFrom for T where
T: From<U>,
[src]
impl<T, U> TryFrom for T where
T: From<U>,
type Error = !
try_from
)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
impl<T> Borrow for T where
T: ?Sized,
[src]
impl<T> Borrow for T where
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
impl<T> Any for T where
T: 'static + ?Sized,
fn get_type_id(&self) -> TypeId
[src]
fn get_type_id(&self) -> TypeId
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
try_from
)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
impl<T> BorrowMut for T where
T: ?Sized,
[src]
impl<T> BorrowMut for T where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
fn borrow_mut(&mut self) -> &mut T