Skip to main content

Crate zerodds_dcps_async

Crate zerodds_dcps_async 

Source
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§

AsyncDataReader
Async wrapper around DataReader<T>.
AsyncDataWriter
Async wrapper around DataWriter<T>.
AsyncDomainParticipant
Async wrapper around DomainParticipant. Topics, pubs and subs are created via the sync API; only the newtype freely switches to the async API.
AsyncDomainParticipantFactory
Async wrapper around the sync singleton. instance() always returns the same singleton; the create_participant methods share state with the sync API.
AsyncPublisher
Async wrapper around Publisher.
AsyncSubscriber
Async wrapper around Subscriber.
DataAvailableStream
Stream of “data available” events. Yields () every time there are new samples in the reader. Does not consume samples — the caller must call take() or take_stream separately.
DataReaderQos
QoS set for a DataReader — Spec §2.2.2.5.2.
DataWriterQos
QoS set for a DataWriter — Spec §2.2.2.4.2 (all policies settable on the DataWriter).
DomainParticipantQos
QoS set for the DomainParticipant — Spec §2.2.2.2.2.
InstanceHandle
Opaque InstanceHandle_t (DDS-DCPS 1.4 §2.3.3).
PublicationMatchedStream
Stream of publication-matched counts. Yields every new count.
PublisherQos
QoS set for the Publisher — Spec §2.2.2.4.1.
SampleStream
Stream over reader samples. Ends when the reader is dropped.
SubscriberQos
QoS set for the Subscriber — Spec §2.2.2.5.1.
SubscriptionMatchedStatus
SUBSCRIPTION_MATCHED_STATUS — Spec §2.2.4.1 + §2.2.2.5.6.
Topic
Typed topic handle.
TopicQos
QoS set for a Topic — Spec §2.2.2.3.2.

Enums§

DdsError
Errors from DCPS operations. Roughly analogous to the spec ReturnCode_t enum; we omit RETCODE_OK (using Result::Ok instead) and merge BAD_PARAMETER + PRECONDITION_NOT_MET where the distinction doesn’t help.

Traits§

DdsType
A type that can be published/subscribed via DDS.

Type Aliases§

Result
Shorthand for DCPS results.