pub struct SerialPortBuilder { /* private fields */ }
Expand description

A struct containing all serial port settings

Implementations§

source§

impl SerialPortBuilder

source

pub fn path<'a>(self, path: impl Into<Cow<'a, str>>) -> Self

Set the path to the serial port

source

pub fn baud_rate(self, baud_rate: u32) -> Self

Set the baud rate in symbols-per-second

source

pub fn data_bits(self, data_bits: DataBits) -> Self

Set the number of bits used to represent a character sent on the line

source

pub fn flow_control(self, flow_control: FlowControl) -> Self

Set the type of signalling to use for controlling data transfer

source

pub fn parity(self, parity: Parity) -> Self

Set the type of parity to use for error checking

source

pub fn stop_bits(self, stop_bits: StopBits) -> Self

Set the number of bits to use to signal the end of a character

source

pub fn timeout(self, timeout: Duration) -> Self

Set the amount of time to wait to receive data before timing out

source

pub fn open(self) -> Result<Box<dyn SerialPort>>

Open a cross-platform interface to the port with the specified settings

source

pub fn open_native(self) -> Result<TTYPort>

Open a platform-specific interface to the port with the specified settings

Trait Implementations§

source§

impl Clone for SerialPortBuilder

source§

fn clone(&self) -> SerialPortBuilder

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for SerialPortBuilder

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl PartialEq<SerialPortBuilder> for SerialPortBuilder

source§

fn eq(&self, other: &SerialPortBuilder) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Eq for SerialPortBuilder

source§

impl StructuralEq for SerialPortBuilder

source§

impl StructuralPartialEq for SerialPortBuilder

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

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

fn clone_into(&self, target: &mut T)

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

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.