Struct tokio_modbus::client::sync::Context
source · pub struct Context { /* private fields */ }
Expand description
A synchronous Modbus client context.
Implementations§
source§impl Context
impl Context
sourcepub fn set_timeout(&mut self, duration: impl Into<Option<Duration>>)
pub fn set_timeout(&mut self, duration: impl Into<Option<Duration>>)
Sets a timeout duration for all subsequent operations.
The timeout is disabled by passing None
.
sourcepub fn reset_timeout(&mut self)
pub fn reset_timeout(&mut self)
Disables the timeout for all subsequent operations.
Trait Implementations§
source§impl Reader for Context
impl Reader for Context
fn read_coils(&mut self, addr: Address, cnt: Quantity) -> Result<Vec<bool>>
fn read_discrete_inputs( &mut self, addr: Address, cnt: Quantity, ) -> Result<Vec<bool>>
fn read_input_registers( &mut self, addr: Address, cnt: Quantity, ) -> Result<Vec<u16>>
fn read_holding_registers( &mut self, addr: Address, cnt: Quantity, ) -> Result<Vec<u16>>
fn read_write_multiple_registers( &mut self, read_addr: Address, read_count: Quantity, write_addr: Address, write_data: &[u16], ) -> Result<Vec<u16>>
source§impl SlaveContext for Context
impl SlaveContext for Context
source§impl Writer for Context
impl Writer for Context
fn write_single_register(&mut self, addr: Address, data: u16) -> Result<()>
fn write_multiple_registers( &mut self, addr: Address, data: &[u16], ) -> Result<()>
fn write_single_coil(&mut self, addr: Address, data: bool) -> Result<()>
fn write_multiple_coils(&mut self, addr: Address, data: &[bool]) -> Result<()>
Auto Trait Implementations§
impl !Freeze for Context
impl !RefUnwindSafe for Context
impl Send for Context
impl !Sync for Context
impl Unpin for Context
impl !UnwindSafe for Context
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