Language bindings: IOPy, TypeScript and Rust
This page is a quick orientation, not a full reference.
1. IOPy (Python)
IOPy is a Cython-based Python module that loads IOP DSO plugins and exposes their packages as Python classes, with full serialization and an IChannel RPC client and server:
import iopy
plugin = iopy.Plugin("/path/to/pkg-iop-plugin.so")
a = plugin.mypkg.KeyFull(key="toto", aggrs=23)
ch = plugin.connect("localhost:20001", _login="root", _password="1234")
res = ch.mypkg_MyModule.myIface.myRpc(key="toto")
IOPy has its own reference: IOPy: the Python binding.
2. TypeScript
The TypeScript backend generates one .iop.ts
module per package: plain interfaces and union types for static typing,
plus *_Model Backbone classes registered by IOP fullname that load
the package’s JSON description at module init and provide runtime
packing and icQuery-based RPC calls. Consumption is therefore: import
the generated module, type your data with the interfaces, and use the
registered models for runtime interaction.
3. Rust
Rust support is emerging (the runtime module still marks itself work-in-progress) and comes in two parts.
Env context storage. The mutable part of the
IOP environment — the context
snapshot — is stored behind a lock-free ArcSwap in the
libcommon-iop-arcswap crate. The C runtime calls into its FFI to
acquire a snapshot, mutate a uniquely-owned copy and atomically install
the new context; the iop_env_t struct itself stays plain C. This is
what makes context snapshots cheap and thread-safe.
Consuming IOP from Rust. A crate binding a C library that exposes IOP
types runs bindgen on the generated <pkg>.iop.h headers. The
waf-cargo-build build-script helper then post-processes that output:
it reads the @iop … annotations the C backend embeds in the headers
and emits typed trait implementations onto the raw bindgen structs. The
traits live in libcommon::iop (Base, Struct/CStruct,
Union/CUnion, Enum/CEnum, plus a GenericStructUnion wrapper),
which also provides Env/EnvCtx handles over iop_env_t and its
snapshot.