pub struct LxiDevice<H: LxiHook = LxiTextHook> { /* private fields */ }
Expand description
Abstract LXI device we can connect and read/write data
Implementations§
Source§impl<H: LxiHook> LxiDevice<H>
impl<H: LxiHook> LxiDevice<H>
pub fn new(addr: (String, u16), timeout: Option<Duration>) -> Self
pub fn address(&self) -> (&str, u16)
pub fn set_timeout(&mut self, timeout: Option<Duration>) -> Result<()>
pub fn timeout(&self) -> Option<Duration>
pub fn is_connected(&self) -> bool
pub fn connect(&mut self) -> Result<()>
pub fn disconnect(&mut self) -> Result<()>
pub fn reconnect(&mut self) -> Result<()>
pub fn send(&mut self, data: &[u8]) -> Result<()>
pub fn receive(&mut self) -> Result<H::Output>
pub fn send_timeout( &mut self, data: &[u8], timeout: Option<Duration>, ) -> Result<()>
pub fn receive_timeout( &mut self, timeout: Option<Duration>, ) -> Result<H::Output>
Auto Trait Implementations§
impl<H> Freeze for LxiDevice<H>
impl<H> RefUnwindSafe for LxiDevice<H>where
H: RefUnwindSafe,
impl<H> Send for LxiDevice<H>where
H: Send,
impl<H> Sync for LxiDevice<H>where
H: Sync,
impl<H> Unpin for LxiDevice<H>where
H: Unpin,
impl<H> UnwindSafe for LxiDevice<H>where
H: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more