pub struct DdsAdapter {
id: AdapterId,
config: DdsConfig,
}Expand description
DDS participant that bridges configured topics both ways.
Inbound samples are stamped with oag.origin_adapter so outbound
writes can refuse the echo when DdsConfig::suppress_echo is on.
The rustdds provider also drops samples whose writer shares this
participant’s GUID prefix, because rustdds delivers local writes.
Fields§
§id: AdapterId§config: DdsConfigImplementations§
Source§impl DdsAdapter
impl DdsAdapter
Sourcepub fn new(id: impl Into<AdapterId>, config: DdsConfig) -> Self
pub fn new(id: impl Into<AdapterId>, config: DdsConfig) -> Self
Builds an adapter that has not yet joined a domain.
pub fn id(&self) -> &AdapterId
pub fn config(&self) -> &DdsConfig
Sourcepub async fn serve(
self: Arc<Self>,
engine: Arc<Engine>,
shutdown: CancellationToken,
) -> Result<(), AdapterError>
pub async fn serve( self: Arc<Self>, engine: Arc<Engine>, shutdown: CancellationToken, ) -> Result<(), AdapterError>
Joins the domain, creates topics, and bridges until shutdown.
§Errors
Returns AdapterError::Failed if the provider cannot join or
a topic cannot be created.
async fn drive( &self, session: &mut dyn DdsSession, engine: Arc<Engine>, eng_rx: &mut Receiver<Delivery>, shutdown: &CancellationToken, ) -> Result<(), AdapterError>
fn forward_outbound( &self, session: &mut dyn DdsSession, delivery: Delivery, ) -> Result<(), String>
async fn poll_inbound( &self, session: &mut dyn DdsSession, engine: &Arc<Engine>, ) -> Result<(), String>
Trait Implementations§
Source§impl Adapter for DdsAdapter
impl Adapter for DdsAdapter
Source§fn run<'async_trait>(
self: Arc<Self>,
engine: Arc<Engine>,
shutdown: CancellationToken,
) -> Pin<Box<dyn Future<Output = Result<(), AdapterError>> + Send + 'async_trait>>where
Self: 'async_trait,
fn run<'async_trait>(
self: Arc<Self>,
engine: Arc<Engine>,
shutdown: CancellationToken,
) -> Pin<Box<dyn Future<Output = Result<(), AdapterError>> + Send + 'async_trait>>where
Self: 'async_trait,
Joins the domain and bridges until shutdown, retrying a
failed or panicked session per DdsConfig::on_panic and
DdsConfig::reconnect.
Each attempt runs on its own child task, so a panic while joined is a join error here rather than an unwind that would otherwise take the retry loop down with it.
§Errors
Returns AdapterError::Failed if the provider cannot join or
a topic cannot be created, and DdsConfig::reconnect is off.