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§
Sourcefn create_reader(
&self,
topic: &str,
type_name: &str,
durability: DurabilityKind,
) -> Result<Box<dyn DataReader>>
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
Sourcefn create_writer(
&self,
topic: &str,
type_name: &str,
durability: DurabilityKind,
) -> Result<Box<dyn DataWriter>>
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
Sourcefn discovered_readers(
&self,
topic_pattern: &str,
) -> Result<Vec<DiscoveredReader>>
fn discovered_readers( &self, topic_pattern: &str, ) -> Result<Vec<DiscoveredReader>>
Get list of discovered readers matching a topic pattern
Sourcefn discovered_writers(
&self,
topic_pattern: &str,
) -> Result<Vec<DiscoveredWriter>>
fn discovered_writers( &self, topic_pattern: &str, ) -> Result<Vec<DiscoveredWriter>>
Get list of discovered writers matching a topic pattern
Sourcefn wait_for_discovery(&self, timeout: Duration) -> Result<bool>
fn wait_for_discovery(&self, timeout: Duration) -> Result<bool>
Wait for discovery events
Returns when new readers/writers are discovered or timeout expires.
Sourcefn register_discovery_callback(
&self,
callback: Arc<dyn DiscoveryCallback>,
) -> Result<()>
fn register_discovery_callback( &self, callback: Arc<dyn DiscoveryCallback>, ) -> Result<()>
Register a discovery callback for endpoint events.