[][src]Struct ur20_modbus::Coupler

pub struct Coupler { /* fields omitted */ }

A Modbus TCP fieldbus coupler implementation.

Methods

impl Coupler[src]

pub async fn connect(addr: SocketAddr) -> Result<Coupler, Error>[src]

Connect to the coupler.

pub async fn disconnect<'_>(&'_ mut self) -> Result<(), Error>[src]

Disconnect the coupler.

pub async fn id<'_>(&'_ mut self) -> Result<String, Error>[src]

Read the actual coupler ID.

pub fn inputs(&self) -> HashMap<Address, ChannelValue>[src]

Current input state.

pub fn outputs(&self) -> HashMap<Address, ChannelValue>[src]

Current output state.

pub fn modules(&self) -> &[ModuleType][src]

List of modules.

pub fn set_output(
    &mut self,
    addr: &Address,
    val: ChannelValue
) -> Result<(), Error>
[src]

Set the value of an output channel.

pub fn binary_input_data(&mut self) -> HashMap<Address, Option<Vec<u8>>>[src]

Read binary input data.

pub async fn tick<'_>(&'_ mut self) -> Result<(), Error>[src]

Run an I/O cycle. This reads all process input registers and writes to process output registers.

Auto Trait Implementations

impl !RefUnwindSafe for Coupler

impl !Send for Coupler

impl !Sync for Coupler

impl Unpin for Coupler

impl !UnwindSafe for Coupler

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.