Skip to main content

DdsInterface

Trait DdsInterface 

Source
pub trait DdsInterface: Send + Sync {
    // Required methods
    fn create_reader(
        &self,
        topic: &str,
        type_name: &str,
        durability: DurabilityKind,
    ) -> Result<Box<dyn DataReader>>;
    fn create_writer(
        &self,
        topic: &str,
        type_name: &str,
        durability: DurabilityKind,
    ) -> Result<Box<dyn DataWriter>>;
    fn discovered_readers(
        &self,
        topic_pattern: &str,
    ) -> Result<Vec<DiscoveredReader>>;
    fn discovered_writers(
        &self,
        topic_pattern: &str,
    ) -> Result<Vec<DiscoveredWriter>>;
    fn wait_for_discovery(&self, timeout: Duration) -> Result<bool>;
    fn register_discovery_callback(
        &self,
        callback: Arc<dyn DiscoveryCallback>,
    ) -> Result<()>;
    fn guid(&self) -> [u8; 16];
}
Expand description

Abstract DDS interface for persistence service

This trait abstracts DDS operations so the persistence service doesn’t depend on concrete HDDS implementation.

Required Methods§

Source

fn create_reader( &self, topic: &str, type_name: &str, durability: DurabilityKind, ) -> Result<Box<dyn DataReader>>

Create a data reader for a topic

The reader should be configured with appropriate QoS for durability:

  • RELIABLE reliability
  • Durability matching the requested policy
Source

fn create_writer( &self, topic: &str, type_name: &str, durability: DurabilityKind, ) -> Result<Box<dyn DataWriter>>

Create a data writer for a topic

The writer should be configured with appropriate QoS:

  • RELIABLE reliability
  • Durability matching the replay target
Source

fn discovered_readers( &self, topic_pattern: &str, ) -> Result<Vec<DiscoveredReader>>

Get list of discovered readers matching a topic pattern

Source

fn discovered_writers( &self, topic_pattern: &str, ) -> Result<Vec<DiscoveredWriter>>

Get list of discovered writers matching a topic pattern

Source

fn wait_for_discovery(&self, timeout: Duration) -> Result<bool>

Wait for discovery events

Returns when new readers/writers are discovered or timeout expires.

Source

fn register_discovery_callback( &self, callback: Arc<dyn DiscoveryCallback>, ) -> Result<()>

Register a discovery callback for endpoint events.

Source

fn guid(&self) -> [u8; 16]

Get participant GUID

Implementors§