Expand description
ZeroDDS async DCPS API (zerodds-async-1.0).
Crate zerodds-dcps-async. Safety classification: STANDARD.
Runtime-agnostic async wrappers around the DCPS sync API. Newtypes
share the internal Arc<...> with the sync counterparts — no
state duplicate, no performance overhead.
§Example
ⓘ
use zerodds_dcps_async::AsyncDomainParticipantFactory;
use futures_core::Stream;
use std::time::Duration;
#[tokio::main]
async fn main() {
let factory = AsyncDomainParticipantFactory::instance();
let participant = factory.create_participant_offline(0);
// ... topic + reader + writer like sync.
let writer = /* ... */;
let reader = /* ... */;
// write & take run without thread block.
writer.write(&sample).await.unwrap();
let samples = reader.take(Duration::from_secs(1)).await.unwrap();
}Spec: docs/specs/zerodds-async-1.0.md.
Structs§
- Async
Data Reader - Async wrapper around
DataReader<T>. - Async
Data Writer - Async wrapper around
DataWriter<T>. - Async
Domain Participant - Async wrapper around
DomainParticipant. Topics, pubs and subs are created via the sync API; only the newtype freely switches to the async API. - Async
Domain Participant Factory - Async wrapper around the sync singleton.
instance()always returns the same singleton; the create_participant methods share state with the sync API. - Async
Publisher - Async wrapper around
Publisher. - Async
Subscriber - Async wrapper around
Subscriber. - Data
Available Stream - Stream of “data available” events. Yields
()every time there are new samples in the reader. Does not consume samples — the caller must calltake()ortake_streamseparately. - Data
Reader Qos - QoS set for a
DataReader— Spec §2.2.2.5.2. - Data
Writer Qos - QoS set for a
DataWriter— Spec §2.2.2.4.2 (all policies settable on the DataWriter). - Domain
Participant Qos - QoS set for the
DomainParticipant— Spec §2.2.2.2.2. - Instance
Handle - Opaque
InstanceHandle_t(DDS-DCPS 1.4 §2.3.3). - Publication
Matched Stream - Stream of publication-matched counts. Yields every new count.
- Publisher
Qos - QoS set for the
Publisher— Spec §2.2.2.4.1. - Sample
Stream - Stream over reader samples. Ends when the reader is dropped.
- Subscriber
Qos - QoS set for the
Subscriber— Spec §2.2.2.5.1. - Subscription
Matched Status SUBSCRIPTION_MATCHED_STATUS— Spec §2.2.4.1 + §2.2.2.5.6.- Topic
- Typed topic handle.
- Topic
Qos - QoS set for a
Topic— Spec §2.2.2.3.2.
Enums§
- DdsError
- Errors from DCPS operations. Roughly analogous to the spec
ReturnCode_tenum; we omitRETCODE_OK(usingResult::Okinstead) and mergeBAD_PARAMETER+PRECONDITION_NOT_METwhere the distinction doesn’t help.
Traits§
- DdsType
- A type that can be published/subscribed via DDS.
Type Aliases§
- Result
- Shorthand for DCPS results.