Struct serial::SerialPort [-] [+] [src]

pub struct SerialPort(_);
[-]

A serial device

Methods

impl SerialPort

fn open(port: &Path) -> Result<SerialPort>[-]

Opens a serial port in "raw" mode with read-only permission

fn baud_rate(&self) -> Result<(BaudRate, BaudRate)>[-]

Returns the input and output baud rates

fn blocking_mode(&self) -> Result<BlockingMode>[-]

Returns the blocking mode used by the device

fn data_bits(&self) -> Result<DataBits>[-]

Returns the number of data bits used per character

fn flow_control(&self) -> Result<FlowControl>[-]

Returns the flow control used by the device

fn parity(&self) -> Result<Parity>[-]

Returns the bit parity used by the device

fn set_baud_rate(&mut self, direction: Direction, rate: BaudRate) -> Result<()>[-]

Changes the baud rate of the input/output or both directions

fn set_blocking_mode(&mut self, mode: BlockingMode) -> Result<()>[-]

Changes the blocking mode used by the device

fn set_data_bits(&mut self, bits: DataBits) -> Result<()>[-]

Changes the number of data bits per character

fn set_flow_control(&mut self, flow: FlowControl) -> Result<()>[-]

Changes the flow control used by the device

fn set_parity(&mut self, parity: Parity) -> Result<()>[-]

Changes the bit parity used by the device

fn set_stop_bits(&mut self, bits: StopBits) -> Result<()>[-]

Changes the number of stop bits per character

fn stop_bits(&self) -> Result<StopBits>[-]

Returns the number of stop bits per character

Trait Implementations

impl Read for SerialPort

fn read(&mut self, buf: &mut [u8]) -> Result<usize>

fn read_to_end(&mut self, buf: &mut Vec<u8>) -> Result<usize>

fn read_to_string(&mut self, buf: &mut String) -> Result<usize>

fn by_ref(&mut self) -> &mut Self

fn bytes(self) -> Bytes<Self>

fn chars(self) -> Chars<Self>

fn chain<R>(self, next: R) -> Chain<Self, R> where R: Read

fn take(self, limit: u64) -> Take<Self>

fn tee<W>(self, out: W) -> Tee<Self, W> where W: Write

impl Write for SerialPort

fn write(&mut self, buf: &[u8]) -> Result<usize>

fn flush(&mut self) -> Result<()>

fn write_all(&mut self, buf: &[u8]) -> Result<()>

fn write_fmt(&mut self, fmt: Arguments) -> Result<()>

fn by_ref(&mut self) -> &mut Self

fn broadcast<W>(self, other: W) -> Broadcast<Self, W> where W: Write