Skip to content

Install for Rust

rustorb is a set of crates on crates.io. It needs Rust 1.85 or later (edition 2024).

Crate What it is
rustorb-core the ORB: Orb, the POA, Any, TypeCode, valuetypes, DII/DSI
rustorb-naming CosNaming stubs (NamingContext, NamingContextExt) and the rustorb-names daemon
rustorb-codegen runs rustorb-idl -brust from a build script
rustorb-cdr, rustorb-giop CDR and GIOP, used by the core
rustorb-ffi the C ABI that the C++ and Java bindings use

Add the crates

cargo add rustorb-core@0.6 rustorb-naming@0.6
cargo add --build rustorb-codegen@0.2

or by hand in Cargo.toml:

[dependencies]
rustorb-core = "0.6"
rustorb-naming = "0.6"     # if you use the naming service

[build-dependencies]
rustorb-codegen = "0.2"

Install the IDL compiler

rustorb-codegen calls the rustorb-idl command, so install it once (see Install):

pip install rustorb-idl     # or: pipx install rustorb-idl

If it is not on PATH, set RUSTORB_IDL to its path when you build.

Generate code from IDL

build.rs
fn main() {
    rustorb_codegen::Config::new()
        .compile(&["idl/Echo.idl"])
        .unwrap();
}
src/lib.rs
include!(concat!(env!("OUT_DIR"), "/echo.rs"));

The output file is named after the IDL file. The Rust tutorial shows the whole program.

Check it

cargo build

The first build compiles tokio and the ORB; later builds only regenerate the code when the IDL changes.

Notes

  • The API is synchronous: the ORB runs its own tokio runtime inside, and calls servants on its own threads. An async API is available too (async-api.md).
  • The API documentation is on docs.rs.