rs-teststand-bridge 0.0.2

Serve the National Instruments TestStand™ Engine to other processes, over any transport
docs.rs failed to build rs-teststand-bridge-0.0.2
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.

rs-teststand-bridge

Serve the National Instruments TestStand™ Engine to other processes.

An addition to rs-teststand, not part of it. The binding stays free of an async runtime and an RPC stack; a caller driving the engine in-process pays for none of this.

Usage

The engine is a single-threaded-apartment COM object, so rs-teststand makes its wrappers neither Send nor Sync: one thread owns the engine and no other may touch it. A server is the opposite: many tasks, any thread.

EngineHost bridges the two. It gives the engine a thread of its own and passes closures to it, so the whole API stays reachable without enumerating it into a command list:

use rs_teststand_bridge::EngineHost;

let host = EngineHost::start()?;
let version = host.with_engine(|engine| engine.version_string()).await??;
# Ok::<(), rs_teststand_bridge::Error>(())

The compiler enforces the apartment rule for free: a COM object cannot be returned out of the closure, because it is not Send. Only plain data crosses.

The same thread also drains the engine's message queue and broadcasts what it finds, so one host can serve requests and stream progress at once.

Nothing here knows about a transport, so the same host serves gRPC, plain TCP, or a local caller that just wants the engine off its own thread.

Not the official National Instruments project

The rs-teststand-bridge crate is not related to National Instruments' own ni/grpc-teststand-api project. It shares no code or protocol definitions with it, and pursues a comparable goal for a different ecosystem and a wider range of engine versions.

Status

Early. EngineHost and the message stream exist; the gRPC services are not written yet. See the workspace TODO.md.

Features

feature effect
grpc the gRPC transport (tonic, prost)
serde make the wire types serialisable in any serde format
live-engine enable tests that instantiate a real engine

License

MIT. TestStand™ is a trademark of National Instruments. This project is not affiliated with or endorsed by National Instruments.