Struct mio_serial::SerialPortBuilder
source · [−]pub struct SerialPortBuilder { /* private fields */ }Expand description
A struct containing all serial port settings
Implementations
sourceimpl SerialPortBuilder
impl SerialPortBuilder
sourcepub fn path<'a>(self, path: impl Into<Cow<'a, str>>) -> SerialPortBuilder
pub fn path<'a>(self, path: impl Into<Cow<'a, str>>) -> SerialPortBuilder
Set the path to the serial port
sourcepub fn baud_rate(self, baud_rate: u32) -> SerialPortBuilder
pub fn baud_rate(self, baud_rate: u32) -> SerialPortBuilder
Set the baud rate in symbols-per-second
sourcepub fn data_bits(self, data_bits: DataBits) -> SerialPortBuilder
pub fn data_bits(self, data_bits: DataBits) -> SerialPortBuilder
Set the number of bits used to represent a character sent on the line
sourcepub fn flow_control(self, flow_control: FlowControl) -> SerialPortBuilder
pub fn flow_control(self, flow_control: FlowControl) -> SerialPortBuilder
Set the type of signalling to use for controlling data transfer
sourcepub fn parity(self, parity: Parity) -> SerialPortBuilder
pub fn parity(self, parity: Parity) -> SerialPortBuilder
Set the type of parity to use for error checking
sourcepub fn stop_bits(self, stop_bits: StopBits) -> SerialPortBuilder
pub fn stop_bits(self, stop_bits: StopBits) -> SerialPortBuilder
Set the number of bits to use to signal the end of a character
sourcepub fn timeout(self, timeout: Duration) -> SerialPortBuilder
pub fn timeout(self, timeout: Duration) -> SerialPortBuilder
Set the amount of time to wait to receive data before timing out
sourcepub fn open(self) -> Result<Box<dyn SerialPort + 'static, Global>, Error>
pub fn open(self) -> Result<Box<dyn SerialPort + 'static, Global>, Error>
Open a cross-platform interface to the port with the specified settings
sourcepub fn open_native(self) -> Result<TTYPort, Error>
pub fn open_native(self) -> Result<TTYPort, Error>
Open a platform-specific interface to the port with the specified settings
Trait Implementations
sourceimpl Clone for SerialPortBuilder
impl Clone for SerialPortBuilder
sourcefn clone(&self) -> SerialPortBuilder
fn clone(&self) -> SerialPortBuilder
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read more
sourceimpl Debug for SerialPortBuilder
impl Debug for SerialPortBuilder
sourceimpl PartialEq<SerialPortBuilder> for SerialPortBuilder
impl PartialEq<SerialPortBuilder> for SerialPortBuilder
sourcefn eq(&self, other: &SerialPortBuilder) -> bool
fn eq(&self, other: &SerialPortBuilder) -> bool
This method tests for self and other values to be equal, and is used
by ==. Read more
sourcefn ne(&self, other: &SerialPortBuilder) -> bool
fn ne(&self, other: &SerialPortBuilder) -> bool
This method tests for !=.
sourceimpl SerialPortBuilderExt for SerialPortBuilder
impl SerialPortBuilderExt for SerialPortBuilder
sourcefn open_native_async(self) -> Result<SerialStream>
fn open_native_async(self) -> Result<SerialStream>
Open a platform-specific interface to the port with the specified settings
impl Eq for SerialPortBuilder
impl StructuralEq for SerialPortBuilder
impl StructuralPartialEq for SerialPortBuilder
Auto Trait Implementations
impl RefUnwindSafe for SerialPortBuilder
impl Send for SerialPortBuilder
impl Sync for SerialPortBuilder
impl Unpin for SerialPortBuilder
impl UnwindSafe for SerialPortBuilder
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
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
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into)Uses borrowed data to replace owned data, usually by cloning. Read more