[]Enum novatel_oem6_api::BaudRate

pub enum BaudRate {
    Baud110,
    Baud300,
    Baud600,
    Baud1200,
    Baud2400,
    Baud4800,
    Baud9600,
    Baud19200,
    Baud38400,
    Baud57600,
    Baud115200,
    BaudOther(usize),
}
[]

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

[]

110 baud.

[]

300 baud.

[]

600 baud.

[]

1200 baud.

[]

2400 baud.

[]

4800 baud.

[]

9600 baud.

[]

19,200 baud.

[]

38,400 baud.

[]

57,600 baud.

[]

115,200 baud.

[]

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
[]

[]

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));

[]

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 Clone for BaudRate
[+]

[]

Returns a copy of the value. Read more

[]

Performs copy-assignment from source. Read more

impl Copy for BaudRate

impl Debug for BaudRate
[+]

[]

Formats the value using the given formatter. Read more

impl Eq for BaudRate

impl PartialEq<BaudRate> for BaudRate
[+]

[]

This method tests for self and other values to be equal, and is used by ==. Read more

[]

This method tests for !=.

Auto Trait Implementations

impl Send for BaudRate

impl Sync for BaudRate

Blanket Implementations

impl<T> From for T
[src]
[]

[]

Performs the conversion.

impl<T, U> Into for T where
    U: From<T>, 
[src]
[]

[]

Performs the conversion.

impl<T> ToOwned for T where
    T: Clone
[src]
[]

[]

Creates owned data from borrowed data, usually by cloning. Read more

[]

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

impl<T, U> TryFrom for T where
    T: From<U>, 
[src]
[]

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

[]

🔬 This is a nightly-only experimental API. (try_from)

Performs the conversion.

impl<T> Borrow for T where
    T: ?Sized
[src]
[]

[]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut for T where
    T: ?Sized
[src]
[]

[]

Mutably borrows from an owned value. Read more

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]
[]

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

[]

🔬 This is a nightly-only experimental API. (try_from)

Performs the conversion.

impl<T> Any for T where
    T: 'static + ?Sized
[src]
[]

[]

🔬 This is a nightly-only experimental API. (get_type_id)

this method will likely be replaced by an associated static

Gets the TypeId of self. Read more