[][src]Crate ichen_openprotocol

Rust access library to read/write iChen® 4 Open Protocol messages.

Details on the protocol can be found here.

Notes on Usage

Beware that all data types defined in this crate use borrowed string slices (i.e. &str) extensively. This is because the most common usage pattern is to create a data variable, set fields, immediately serialize it into JSON, then dispose of the data variable. The deserialization story is similar.

Error values also borrow heavily from the input fields as these errors are expected to be handled as soon as possible.

The result is minimal allocations and copying, but at the cost of stricter lifetime management, especially when deserializing -- the message struct cannot out-live the original JSON text string as fields are borrowed extensively from the original JSON string.

Another implication due to extensive usage of borrowed string slices is that string literals with escape sequences will cause parsing errors because the actual string cannot be simply borrowed from the original JSON string. Luckily this is extremely rare for most fields holding names, ID's etc. For this reason, only certain user-defined text fields (such as job_card_id) may contain escaped characters (especially the double-quote); those are therefore modeled using Cow<&str> instead.

Structs

Controller

A data structure containing the current known status of a controller.

Filters

General authorizations to access the iChen System via Open Protocol.

GeoLocation

A data structure containing a single physical geo-location.

JobCard

A data structure containing information on a production job (i.e. a job card).

KeyValuePair

A general data structure holding a key and value pair.

MessageOptions

Common options of an Open Protocol message.

Operator

A data structure containing information on a single user on the system.

StateValues

A data structure containing a snapshot of the current known states of the controller.

Enums

JobMode

Job modes of the controller.

Language

Supported UI languages for the controller's HMI.

Message

All Open Protocol message types.

OpMode

Operating modes of the controller.

OpenProtocolError

Result error type.

Type Definitions

Result

Result type.