[][src]Struct vcontrol::Optolink

pub struct Optolink { /* fields omitted */ }

An Optolink connection via either a serial or TCP connection.

Methods

impl Optolink[src]

pub fn open(port: impl AsRef<OsStr>) -> Result<Optolink>[src]

Opens a serial device.

Examples

use vcontrol::Optolink;

let mut device = Optolink::open("/dev/ttyUSB0")?;

pub fn connect(addr: impl ToSocketAddrs) -> Result<Optolink>[src]

Connects to a device via TCP.

Examples

use vcontrol::Optolink;

let mut device = Optolink::connect(("localhost", 1234))?;

pub fn purge(&mut self) -> Result<(), Error>[src]

Purge all contents of the input buffer.

pub fn set_timeout(&mut self, timeout: Option<Duration>) -> Result<()>[src]

Trait Implementations

impl Debug for Optolink[src]

impl Read for Optolink[src]

impl Write for Optolink[src]

Auto Trait Implementations

Blanket Implementations

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

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

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

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

impl<T, U> Into<U> for T where
    U: From<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.