Expand description
Crate zerodds-rpc. Safety classification: STANDARD.
DDS-RPC 1.0 (OMG formal/16-12-04) request/reply framework on
the ZeroDDS DCPS stack.
§Layer position
Layer 4 — core services. Builds on zerodds-dcps (DataWriter/
DataReader) + zerodds-idl (IDL AST) + zerodds-qos (DDS QoS) +
zerodds-xml (profile loader).
§Public API (Stand 1.0.0-rc.1)
Foundation (Spec §7.3-§7.5):
common_types—RequestHeader,ReplyHeader,SampleIdentity,RemoteExceptionCode_t(Spec §7.5.1.1.1) with XCDR2 encode/decode.topic_naming— topic naming convention<Service>_Request/<Service>_Reply(Spec §7.8.2) plus service name validation.annotations— lowering of the RPC IDL annotations@service,@oneway,@in,@out,@inout(Spec §7.3).service_mapping— data-model lowering of an IDL service definition toServiceDef/MethodDef/ParamDef(Spec §7.4).codegen— request/reply struct pairs (basic + enhanced) +CallUnion(Spec §7.5.1).rpc_hash—rpc_member_hashfor the Spec §7.5.4 member hash.
Runtime (Spec §7.9-§7.11):
requester—Requester<TIn, TOut>: send a request, reply viaSampleIdentitycorrelation, blocking + tick-driven API.replier—Replier<TIn, TOut>incl. theReplierHandlertrait +FnHandleradapter.qos_profile—RpcQoswith spec defaults + XML profile resolution againstzerodds-xml::DdsXml.wire_codec— encoder/decoder for request and reply frames (header XCDR2 + user payload).endpoint—RpcEndpointBuilderas a convenience constructor.
Cross-cutting (Spec §7.6-§7.8):
discovery_ext—PublicationBuiltinTopicDataExt+ service-match logic.function_call—FunctionStub/FunctionSkeleton/dispatch_request(Spec §7.7).evolution_rules— compatibility mappings (Spec §7.6.5).request_identity—RequestIdentity(spec-layer wrapper).
§Example
ⓘ
use zerodds_rpc::{Requester, RpcEndpointBuilder};
// ... see README.md for a complete quickstart example.Re-exports§
pub use annotations::LoweredRpc;pub use annotations::RpcAnnotation;pub use annotations::lower_rpc_annotations;pub use codegen::CallUnionCase;pub use codegen::CallUnionDef;pub use codegen::MemberType;pub use codegen::MethodPair;pub use codegen::ReplyType;pub use codegen::RequestType;pub use codegen::ServiceLayout;pub use codegen::StructMember;pub use codegen::build_basic_pair;pub use codegen::build_enhanced_all;pub use codegen::build_enhanced_pair;pub use common_types::MAX_HEADER_BYTES;pub use common_types::MAX_STRING_LEN;pub use common_types::RemoteExceptionCode;pub use common_types::ReplyHeader;pub use common_types::RequestHeader;pub use common_types::SampleIdentity;pub use discovery_ext::PublicationBuiltinTopicDataExt;pub use discovery_ext::ServiceMappingProfile;pub use discovery_ext::SubscriptionBuiltinTopicDataExt;pub use discovery_ext::client_matches_service;pub use discovery_ext::service_matches_client;pub use endpoint::ReplierEndpoint;pub use endpoint::RequesterEndpoint;pub use endpoint::RpcEndpointBuilder;pub use error::RpcError;pub use error::RpcResult;pub use evolution_rules::Evolution;pub use evolution_rules::Mapping;pub use evolution_rules::compatible_evolutions;pub use evolution_rules::is_compatible;pub use function_call::FunctionSkeleton;pub use function_call::FunctionStub;pub use function_call::OperationDescriptor;pub use function_call::ServiceDescriptor;pub use function_call::dispatch_request;pub use request_identity::RequestIdentity;pub use rpc_hash::rpc_member_hash;pub use service_mapping::MethodDef;pub use service_mapping::ParamDef;pub use service_mapping::ParamDirection;pub use service_mapping::ServiceDef;pub use service_mapping::TypeRef;pub use service_mapping::lower_service;pub use topic_naming::REPLY_SUFFIX;pub use topic_naming::REQUEST_SUFFIX;pub use topic_naming::ServiceTopicNames;pub use topic_naming::reply_topic_name;pub use topic_naming::request_topic_name;pub use topic_naming::validate_service_name;
Modules§
- annotations
- DDS-RPC IDL annotations — Spec §7.3.
- codegen
- Request/reply codegen data model — Spec §7.5.1.
- common_
types - DDS-RPC common types — Spec §7.5.1.1.1.
- discovery_
ext - RPC discovery extensions (Spec §7.6.2.x).
- endpoint
- RPC endpoint helper — Spec §7.6.2.
- error
- Error types for the DDS-RPC crate (C6.1.A).
- evolution_
rules - Service-evolution compatibility rules (Spec §7.7).
- function_
call - Function-call-style service API (Spec §7.2.2.1, §7.9.2.1, §7.10.1).
- qos_
profile RpcQos— QoS profile resolution for DDS-RPC (Spec §7.11).- replier
Replier— server side of a DDS-RPC service (Spec §7.10).- request_
identity - Request-Identity-Propagation (Spec §7.8.2.x).
- requester
Requester— client side of a DDS-RPC service (Spec §7.9).- rpc_
hash - RPC-specific hashing algorithm (Spec §7.5.1.1.2).
- service_
mapping - Service IDL → typed service data model — Spec §7.4.
- topic_
naming - DDS-RPC topic naming convention — Spec §7.8.2.
- wire_
codec - Wire codec for request and reply samples (foundation C6.1.C).