API Model

The core library is written in idiomatic Rust without any real thought for how it will be bound into other languages. Consequently, the Rust API doesn't always correlate 100% with the various binding APIs. This guide is still helpful for Rust users, but readers should be aware that the guide is primarily written from the perspective of the bindings.

Generic Terminology#

The guide use terms like struct, interface, and class frequently. These terms do not map directly to all languages. Refer to the following language-specific pages for how to interpret these terms. For example, Rust doesn't have inheritance, and therefore doesn't have an interface concept in the same way that C# and Java do. Rust users can assume that we're talking about a boxed trait object whenever we talk about an interface.

The following language pages discuss how these abstract concepts map to language-specific implementations.

Model#

We use an internally developed binding generator called oo_bindgen to produce idiomatic bindings for each target language. You can read more about our approach to binding generation in this blog post.

Using a Rust API, we model the following constructs and their documentation:

  • native functions
  • native structs
  • constants
  • abstract interfaces
  • iterators
  • classes
    • constructor/destructor
    • static methods
    • instance methods
    • asynchronous methods

The model produced by this API is then consumed by language-specific code generators to emit idiomatic bindings for that language.

Diagram#

JavaTCPUDPTLSSerial.NETC++C APIGenerated from modelRustDNP3Async Runtime