Struct serial_win::Connection [-] [+] [src]

pub struct Connection {
    // some fields omitted
}

A serial connection

Methods

impl Connection

fn new(port: &str, baud_rate: u32) -> Result<Connection>

Open a new connection via port port with baud rate baud_rate

fn set_timeout(&mut self, timeout_ms: u32) -> Result<()>

Set interval and total timeouts to timeout_ms

fn baud_rate(&self) -> Result<u32>

fn set_baud_rate(&mut self, baud_rate: u32) -> Result<()>

fn byte_size(&self) -> Result<u8>

fn set_byte_size(&mut self, byte_size: u8) -> Result<()>

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

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

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

fn set_stop_bits(&mut self, stop_bits: StopBits) -> Result<()>

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

Read into buf until delim is encountered. Return n.o. bytes read on success, and an IO error on failure.

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

Read until newline. Return n.o. bytes read on success

Trait Implementations

impl Read for Connection

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

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

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

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 Connection

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

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

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

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

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

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

impl Drop for Connection

fn drop(&mut self)

impl Send for Connection