A CORBA ORB with its core written in Rust, and bindings for Rust, Python, C++ and Java. (日本語)
Documentation: https://rustorb.github.io/ (quick start, install and tutorials for every language)
rustorb speaks GIOP 1.0 to 1.2 over IIOP, SSLIOP and omniORB's Unix domain sockets, and is tested in CI against omniORB, omniORBpy and JacORB in every combination of client, server and naming service. It aims to replace omniORB / omniORBpy in existing systems: the Python binding generates the same API as omniidl -bpython, and a compatibility package runs omniORBpy applications such as OpenRTM-aist-Python unchanged.
- Protocol: CDR, GIOP 1.0–1.2 with fragments, IORs,
corbaloc:andcorbaname:, code set negotiation, bidirectional GIOP, SSLIOP (TLS with rustls), omniORB'sgiop:unixendpoints (Unix domain sockets, Linux and macOS) - Server side: the POA with the standard policies, servant managers,
default servants, adapter activators, the three thread models and the
POAManagerFactory - Types: Any, TypeCode, DynAny,
fixed,long double, valuetypes (custom, truncatable, boxed,supports), abstract interfaces - Naming Service: CosNaming client and server, and the
rustorb-namesdaemon (a replacement for omniNames, with persistence) - Asynchronous calls: callback AMI (
sendc_and reply handlers) for Python, C++ and Java withrustorb-idl -Wbami, an optional async API for Rust - More: DII / DSI (Rust, Python, C++ and Java), Portable Interceptors,
policies, call timeouts and
SyncScopefor oneway calls, omniORBpy'somniORB.URI, tracing
| Language | Package | IDL compiler |
|---|---|---|
| Rust | rustorb-core, rustorb-naming (crates.io) |
rustorb-codegen in build.rs |
| Python | pip install rustorb (abi3 wheels for CPython 3.9+) |
rustorb-idl -bpython |
| C++ (C++17) | rustorb-native archive of the GitHub release, or cmake --install of cpp/; then find_package(rustorb) |
rustorb-idl -bc++11 |
| Java (22+) | rustorb-<version>.jar and the shared library of rustorb-native from the GitHub release |
rustorb-idl -bjava |
The IDL compiler is pip install rustorb-idl for every language; it lives in
rustorb/rustorb-idl and is released on its own. The naming
service is cargo install rustorb-naming (the rustorb-names binary).
// Echo.idl
module Example {
interface Echo {
string echo(in string message);
};
};
A Python server and client:
pip install rustorb rustorb-idl
rustorb-idl -bpython Echo.idl # Example/, Example__POA/
import sys
from rustorb import CORBA, PortableServer
import Example, Example__POA
class EchoImpl(Example__POA.Echo):
def echo(self, message):
return message
orb = CORBA.ORB_init(sys.argv)
poa = orb.resolve_initial_references("RootPOA")
poa._get_the_POAManager().activate()
ior = orb.object_to_string(EchoImpl()._this())
echo = orb.string_to_object(ior)._narrow(Example.Echo)
print(echo.echo("hello"))
orb.destroy()
The getting started guide goes through the same
server and client in Rust, Python, C++ and Java, registered in the naming
service; the code is in examples/, and
examples/run-all.sh runs every server with every client.
- The official site, https://rustorb.github.io/ (日本語): quick start, installation and a tutorial for each language
- Getting started and examples
- Changelog and how releases are made
- Design documents (in Japanese): development plan, Rust mapping (compared with other IDL-to-Rust mappings), Python binding, Python generator, omniORBpy compatibility, C++ binding, Java binding, POA, Any and TypeCode, DynAny, valuetypes, DII / DSI, callback AMI, Portable Interceptors, SSLIOP, Unix domain sockets, bidirectional GIOP, connections, timeouts, SyncScope, ORB operations, tracing, async API, load testing, CORBA compliance, unsupported CORBA features
- Interoperability tests: interop/
cargo build --workspace
cargo test --workspace
The Python, C++ and Java tests need the IDL compiler, at the version
pinned in tools/rustorb-idl.txt (pip install -r tools/rustorb-idl.txt; to
try a checkout of rustorb-idl, set RUSTORB_IDL_DIR to it):
pip install -r tools/rustorb-idl.txt
python/build-native.sh # the native module, into python/rustorb
python3 -m unittest discover -s python/tests
cmake -S cpp -B build/cpp && cmake --build build/cpp && ctest --test-dir build/cpp
mvn -f java/pom.xml verify # Java 22 or later
The Rust code generated from IDL that is checked in (rustorb-naming,
interop/impls/rustorb, the mapping tests in tests/mapping) is regenerated with
tools/generate-rust.sh when the IDL or the generator
changes; CI checks it. Fuzzing needs nightly and cargo-fuzz:
cargo +nightly fuzz run giop_message.
rustorb is licensed under either of
- Apache License, Version 2.0 (LICENSE-APACHE)
- MIT license (LICENSE-MIT)
at your option.
The IDL compiler (rustorb-idl and the rustorb-codegen crate, in the
separate repository rustorb/rustorb-idl) is
GPL-3.0-or-later, because it builds on idl_parser. Code it generates is not
covered by that license: the owner of the input IDL chooses its license, and
the boilerplate rustorb puts into it is MIT OR Apache-2.0.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in rustorb by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.