Skip to main content

nros_node/
session.rs

1//! Concrete session type aliases resolved at compile time.
2//!
3//! Exactly one RMW backend feature must be enabled. The aliases below
4//! map the generic `Session` associated types to the concrete handles
5//! provided by the active backend, eliminating the need for generic
6//! type parameters on `Executor`, `Node`, and entity types.
7
8use nros_rmw::Session;
9
10#[cfg(feature = "rmw-cffi")]
11pub(crate) type ConcreteSession = nros_rmw_cffi::CffiSession;
12#[cfg(all(test, not(feature = "rmw-cffi")))]
13pub(crate) type ConcreteSession = crate::mock::MockSession;
14
15/// Concrete publisher handle for the active RMW backend.
16pub type RmwPublisher = <ConcreteSession as Session>::PublisherHandle;
17/// Concrete subscriber handle for the active RMW backend.
18pub type RmwSubscriber = <ConcreteSession as Session>::SubscriberHandle;
19/// Concrete service server handle for the active RMW backend.
20pub type RmwServiceServer = <ConcreteSession as Session>::ServiceServerHandle;
21/// Concrete service client handle for the active RMW backend.
22pub type RmwServiceClient = <ConcreteSession as Session>::ServiceClientHandle;