Skip to main content

Module function_call

Module function_call 

Source
Expand description

Function-call-style service API (Spec §7.2.2.1, §7.9.2.1, §7.10.1).

The DDS-RPC spec defines two language-binding styles:

  1. Request/reply style (low-level) — crates/rpc/src/{requester, replier}.rs.
  2. Function-call style (high-level) — this module.

Function-call style uses stubs (client-side proxy) and skeletons (service-side dispatch), generated at codegen time from a service definition (IDL interface Foo { void op(); }). The stubs look like native function calls, but internally encapsulate the request/reply path.

§Architecture

Here we provide the runtime foundation for generated stubs and skeletons:

  • The FunctionStub trait for client-side proxies (each generated stub class implements it).
  • The FunctionSkeleton trait for service-side dispatch — calls the right operation from the request_data union discriminator and returns the reply.
  • The dispatch_request helper for skeleton implementations.

Codegen templates live in crates/idl-cpp/src/rpc_template.rs (C++) and crates/idl-java/src/rpc_template.rs (Java).

Structs§

OperationDescriptor
Operation descriptor for codegen.
ServiceDescriptor
Service descriptor for codegen — collection of OperationDescriptors.

Traits§

FunctionSkeleton
Skeleton trait: every generated service-side dispatch implements it. The skeleton unpacks the request discriminator, calls the matching operation in the user implementation and packs the reply back as a union.
FunctionStub
Stub trait: every generated client-side proxy implements it.

Functions§

dispatch_request
Dispatcher helper for skeleton implementations.