[][src]Struct tokio_serial::Serial

pub struct Serial { /* fields omitted */ }

Serial port I/O struct.

Methods

impl Serial[src]

pub fn from_path<P>(path: P, settings: &SerialPortSettings) -> Result<Serial> where
    P: AsRef<Path>, 
[src]

Open serial port from a provided path, using the default reactor.

pub fn pair() -> Result<(Self, Self)>[src]

Create a pair of pseudo serial terminals using the default reactor

Returns

Two connected, unnamed Serial objects.

Errors

Attempting any IO or parameter settings on the slave tty after the master tty is closed will return errors.

pub fn set_exclusive(&mut self, exclusive: bool) -> Result<()>[src]

Sets the exclusivity of the port

If a port is exclusive, then trying to open the same device path again will fail.

See the man pages for the tiocexcl and tiocnxcl ioctl's for more details.

Errors

  • Io for any error while setting exclusivity for the port.

pub fn exclusive(&self) -> bool[src]

Returns the exclusivity of the port

If a port is exclusive, then trying to open the same device path again will fail.

Trait Implementations

impl Read for Serial[src]

impl Write for Serial[src]

impl AsRawFd for Serial[src]

impl SerialPort for Serial[src]

impl AsyncRead for Serial[src]

impl AsyncWrite for Serial[src]

Auto Trait Implementations

impl Send for Serial

impl Sync for Serial

impl Unpin for Serial

impl !UnwindSafe for Serial

impl !RefUnwindSafe for Serial

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]