Struct serial_unix::TTYPort [] [src]

pub struct TTYPort { /* fields omitted */ }

A TTY-based serial port implementation.

The port will be closed when the value is dropped.

Methods

impl TTYPort
[src]

Opens a TTY device as a serial port.

path should be the path to a TTY device, e.g., /dev/ttyS0.

use std::path::Path;

serial_unix::TTYPort::open(Path::new("/dev/ttyS0")).unwrap();

Errors

  • NoDevice if the device could not be opened. This could indicate that the device is already in use.
  • InvalidInput if port is not a valid device name.
  • Io for any other error while opening or initializing the device.

Trait Implementations

impl Drop for TTYPort
[src]

A method called when the value goes out of scope. Read more

impl AsRawFd for TTYPort
[src]

Extracts the raw file descriptor. Read more

impl Read for TTYPort
[src]

Pull some bytes from this source into the specified buffer, returning how many bytes were read. Read more

Read all bytes until EOF in this source, placing them into buf. Read more

Read all bytes until EOF in this source, placing them into buf. Read more

Read the exact number of bytes required to fill buf. Read more

Creates a "by reference" adaptor for this instance of Read. Read more

Transforms this Read instance to an Iterator over its bytes. Read more

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

the semantics of a partial read/write of where errors happen is currently unclear and may change

Transforms this Read instance to an Iterator over chars. Read more

Creates an adaptor which will chain this stream with another. Read more

Creates an adaptor which will read at most limit bytes from it. Read more

impl Write for TTYPort
[src]

Write a buffer into this object, returning how many bytes were written. Read more

Flush this output stream, ensuring that all intermediately buffered contents reach their destination. Read more

Attempts to write an entire buffer into this write. Read more

Writes a formatted string into this writer, returning any error encountered. Read more

Creates a "by reference" adaptor for this instance of Write. Read more

impl SerialDevice for TTYPort
[src]

A type that implements the settings for the serial port device. Read more

Returns the device's current settings. Read more

Applies new settings to the serial device. Read more

Returns the current timeout.

Sets the timeout for future I/O operations.

Sets the state of the RTS (Request To Send) control signal. Read more

Sets the state of the DTR (Data Terminal Ready) control signal. Read more

Reads the state of the CTS (Clear To Send) control signal. Read more

Reads the state of the DSR (Data Set Ready) control signal. Read more

Reads the state of the RI (Ring Indicator) control signal. Read more

Reads the state of the CD (Carrier Detect) control signal. Read more