Skip to main content

nros_node/executor/
ffi.rs

1//! The executor's FFI surface.
2//!
3//! Methods that exist for `nros-c` and `nros-cpp` -- the C-shaped entry points
4//! (raw pointers, `extern "C"` callbacks, `unsafe` release paths) and the
5//! plumbing those shims reach into -- are not part of the Rust user API. They
6//! live here, behind a SEALED trait that the shims import and `nros` never
7//! re-exports, so a Rust user neither sees them in the `nros` docs nor can
8//! call them through `nros`. Each one is a crate-private inherent method of
9//! [`Executor`]; this trait forwards to it, and nothing else implements it.
10//!
11//! Stage 2 does the same for the untyped action machinery: every method of
12//! [`ActionServerCore`], [`ActionClientCore`], [`ActionServerRawHandle`] and
13//! [`ActionClientRawHandle`] sits behind its own sealed `*Ffi` trait below. The
14//! types stay public, because the sizes probe and the shims' storage name them.
15//!
16//! Not `#[doc(hidden)]`: that leaves a method callable and semver-visible.
17#![allow(clippy::too_many_arguments, clippy::missing_safety_doc)]
18
19use core::mem::MaybeUninit;
20
21use nros_core::{GoalStatusCode, GoalUuid, Time};
22use nros_rmw::QoSProfile;
23
24use super::{
25    action_core::{PendingCancelRequest, RawGoalRequest},
26    *,
27};
28use crate::{session, timer::TimerDuration};
29
30/// `ParameterServer`'s operations, for the shims
31/// that reach the store through this crate rather than `nros-params`.
32#[cfg(feature = "param-store")]
33pub use nros_params::ParameterServerOps;
34
35mod sealed {
36    pub trait Sealed {}
37}
38impl sealed::Sealed for Executor<'_> {}
39
40/// The executor's FFI entry points, for `nros-c` and `nros-cpp`. Sealed.
41pub trait ExecutorFfi<'s>: sealed::Sealed + Sized {
42    // phase-515 R10 stage 1b -- the per-node parameter forms. The `Node`
43    // that `node_mut(id)` returns carries the user-facing verbs; these are
44    // the shims' node-id-keyed entry points.
45
46    #[cfg(all(feature = "param-store", feature = "alloc"))]
47    /// The FFI entry point; see `Executor::argv_param_overrides_on` in `spin.rs`.
48    #[cfg(feature = "param-store")]
49    fn argv_param_overrides_on(
50        &self,
51        node: super::node_record::NodeId,
52    ) -> impl Iterator<Item = (&str, nros_params::ParameterValue)> + '_;
53
54    #[cfg(all(feature = "param-store", feature = "alloc"))]
55    /// The FFI entry point; see `Executor::for_each_argv_param_override_on` in `spin.rs`.
56    #[cfg(feature = "param-store")]
57    fn for_each_argv_param_override_on(
58        &self,
59        node: super::node_record::NodeId,
60        f: impl FnMut(&str, &nros_params::ParameterValue),
61    ) -> usize;
62
63    /// The FFI entry point; see `Executor::declare_parameter_on` in `spin.rs`.
64    #[cfg(feature = "param-store")]
65    fn declare_parameter_on(
66        &mut self,
67        node: super::node_record::NodeId,
68        name: &str,
69        value: nros_params::ParameterValue,
70    ) -> bool;
71
72    /// The FFI entry point; see `Executor::declare_parameter_on_ref` in `spin.rs`.
73    #[cfg(feature = "param-store")]
74    fn declare_parameter_on_ref(
75        &mut self,
76        node: super::node_record::NodeId,
77        name: &str,
78        value: &nros_params::ParameterValue,
79    ) -> bool;
80
81    /// The FFI entry point; see `Executor::seed_launch_parameter_on_ref` in `spin.rs`.
82    #[cfg(feature = "param-store")]
83    fn seed_launch_parameter_on_ref(
84        &mut self,
85        node: super::node_record::NodeId,
86        name: &str,
87        value: &nros_params::ParameterValue,
88    ) -> bool;
89
90    /// The FFI entry point; see `Executor::adopt_launch_seed_on` in `spin.rs`.
91    #[cfg(feature = "param-store")]
92    fn adopt_launch_seed_on(
93        &mut self,
94        node: super::node_record::NodeId,
95        name: &str,
96        param_type: nros_params::ParameterType,
97        descriptor: Option<&nros_params::ParameterDescriptor>,
98    ) -> Option<Result<(), nros_params::DeclarationError>>;
99
100    /// The FFI entry point; see `Executor::declare_parameter_with_descriptor_on` in `spin.rs`.
101    #[cfg(feature = "param-store")]
102    fn declare_parameter_with_descriptor_on(
103        &mut self,
104        node: super::node_record::NodeId,
105        name: &str,
106        value: nros_params::ParameterValue,
107        descriptor: nros_params::ParameterDescriptor,
108    ) -> bool;
109
110    /// The FFI entry point; see `Executor::report_parameter_refused` in `spin.rs`.
111    #[cfg(feature = "param-store")]
112    fn report_parameter_refused(&self, node: super::node_record::NodeId, name: &str) -> bool;
113
114    /// The FFI entry point; see `Executor::set_parameter_on` in `spin.rs`.
115    #[cfg(feature = "param-store")]
116    fn set_parameter_on(
117        &mut self,
118        node: super::node_record::NodeId,
119        name: &str,
120        value: nros_params::ParameterValue,
121    ) -> Result<(), nros_params::ParameterError>;
122
123    /// The FFI entry point; see `Executor::set_parameter_on_ref` in `spin.rs`.
124    #[cfg(feature = "param-store")]
125    fn set_parameter_on_ref(
126        &mut self,
127        node: super::node_record::NodeId,
128        name: &str,
129        value: &nros_params::ParameterValue,
130    ) -> Result<(), nros_params::ParameterError>;
131
132    /// The FFI entry point; see `Executor::set_parameter_local_on` in `spin.rs`.
133    #[cfg(feature = "param-store")]
134    fn set_parameter_local_on(
135        &mut self,
136        node: super::node_record::NodeId,
137        name: &str,
138        value: nros_params::ParameterValue,
139    ) -> Result<(), nros_params::ParameterError>;
140
141    #[cfg(feature = "param-services")]
142    /// The FFI entry point; see `Executor::disable_parameter_events_on` in `spin.rs`.
143    #[cfg(feature = "param-store")]
144    fn disable_parameter_events_on(&mut self, node: super::node_record::NodeId);
145
146    #[cfg(feature = "param-services")]
147    /// The FFI entry point; see `Executor::enable_parameter_events_on` in `spin.rs`.
148    #[cfg(feature = "param-store")]
149    fn enable_parameter_events_on(
150        &mut self,
151        node: super::node_record::NodeId,
152    ) -> Result<(), NodeError>;
153
154    /// The FFI entry point; see `Executor::delete_parameters_on_not_set_on` in `spin.rs`.
155    #[cfg(feature = "param-store")]
156    fn delete_parameters_on_not_set_on(&mut self, node: super::node_record::NodeId, on: bool);
157
158    /// The FFI entry point; see `Executor::allow_undeclared_parameters_on` in `spin.rs`.
159    #[cfg(feature = "param-store")]
160    fn allow_undeclared_parameters_on(&mut self, node: super::node_record::NodeId, allow: bool);
161
162    /// The FFI entry point; see `Executor::get_parameter_on` in `spin.rs`.
163    #[cfg(feature = "param-store")]
164    fn get_parameter_on(
165        &self,
166        node: super::node_record::NodeId,
167        name: &str,
168    ) -> Option<&nros_params::ParameterValue>;
169
170    /// The FFI entry point; see `Executor::parameter_on` in `spin.rs`.
171    #[cfg(feature = "param-store")]
172    fn parameter_on<'a, T: nros_params::ParameterVariant>(
173        &'a mut self,
174        node: super::node_record::NodeId,
175        name: &'a str,
176    ) -> Result<nros_params::ParameterBuilder<'a, 's, T>, NodeError>;
177
178    /// The FFI entry point; see `Executor::set_parameter_description_on` in `spin.rs`.
179    #[cfg(feature = "param-store")]
180    fn set_parameter_description_on(
181        &mut self,
182        node: super::node_record::NodeId,
183        name: &str,
184        description: &str,
185        additional_constraints: &str,
186    ) -> bool;
187
188    /// The FFI entry point; see `Executor::set_parameter_read_only_on` in `spin.rs`.
189    #[cfg(feature = "param-store")]
190    fn set_parameter_read_only_on(
191        &mut self,
192        node: super::node_record::NodeId,
193        name: &str,
194        read_only: bool,
195    ) -> bool;
196
197    /// The FFI entry point; see `Executor::set_parameter_integer_range_on` in `spin.rs`.
198    #[cfg(feature = "param-store")]
199    fn set_parameter_integer_range_on(
200        &mut self,
201        node: super::node_record::NodeId,
202        name: &str,
203        min: i64,
204        max: i64,
205        step: i64,
206    ) -> bool;
207
208    /// The FFI entry point; see `Executor::set_parameter_float_range_on` in `spin.rs`.
209    #[cfg(feature = "param-store")]
210    fn set_parameter_float_range_on(
211        &mut self,
212        node: super::node_record::NodeId,
213        name: &str,
214        min: f64,
215        max: f64,
216        step: f64,
217    ) -> bool;
218
219    /// The FFI entry point; see `Executor::describe_parameter_on` in `spin.rs`.
220    #[cfg(feature = "param-store")]
221    fn describe_parameter_on(
222        &self,
223        node: super::node_record::NodeId,
224        name: &str,
225    ) -> Option<&nros_params::ParameterDescriptor>;
226
227    /// The FFI entry point; see `Executor::get_parameter_type_on` in `spin.rs`.
228    #[cfg(feature = "param-store")]
229    fn get_parameter_type_on(
230        &self,
231        node: super::node_record::NodeId,
232        name: &str,
233    ) -> Option<nros_params::ParameterType>;
234
235    /// The FFI entry point; see `Executor::list_parameters_on` in `spin.rs`.
236    #[cfg(feature = "param-store")]
237    fn list_parameters_on<'p>(
238        &'p self,
239        node: super::node_record::NodeId,
240        prefix: &'p str,
241    ) -> impl Iterator<Item = &'p str>;
242
243    /// The FFI entry point; see `Executor::declared_parameter_count_on` in `spin.rs`.
244    #[cfg(feature = "param-store")]
245    fn declared_parameter_count_on(&self, node: super::node_record::NodeId) -> usize;
246
247    /// The FFI entry point; see `Executor::set_parameters_atomically_on` in `spin.rs`.
248    #[cfg(feature = "param-store")]
249    fn set_parameters_atomically_on<'x, I>(
250        &mut self,
251        node: super::node_record::NodeId,
252        items: I,
253    ) -> Result<(), nros_params::ParameterError>
254    where
255        I: Iterator<Item = Option<(&'x str, nros_params::ParameterValue)>> + Clone;
256
257    /// The FFI entry point; see `Executor::set_parameters_atomically_with_on` in `spin.rs`.
258    #[cfg(feature = "param-store")]
259    fn set_parameters_atomically_with_on<'x>(
260        &mut self,
261        node: super::node_record::NodeId,
262        count: usize,
263        fill: impl FnMut(usize, &mut nros_params::ParameterValue) -> Option<&'x str>,
264    ) -> Result<(), nros_params::ParameterError>;
265
266    /// The FFI entry point; see `Executor::undeclare_parameter_on` in `spin.rs`.
267    #[cfg(feature = "param-store")]
268    fn undeclare_parameter_on(&mut self, node: super::node_record::NodeId, name: &str) -> bool;
269
270    /// The FFI entry point; see `Executor::add_on_set_parameters_callback_on` in `spin.rs`.
271    #[cfg(feature = "param-store")]
272    fn add_on_set_parameters_callback_on(
273        &mut self,
274        node: super::node_record::NodeId,
275        callback: nros_params::OnSetParameterFn,
276        ctx: nros_params::OnSetContext,
277    ) -> Option<nros_params::OnSetParameterHandle>;
278
279    /// The FFI entry point; see `Executor::use_undeclared_parameters_on` in `spin.rs`.
280    #[cfg(feature = "param-store")]
281    fn use_undeclared_parameters_on(
282        &mut self,
283        node: super::node_record::NodeId,
284    ) -> Result<nros_params::Parameters<'_, 's>, NodeError>;
285
286    /// The FFI entry point; see `Executor::add_arena_subscription_c_callback` in `spin.rs`.
287    #[allow(clippy::too_many_arguments)]
288    fn add_arena_subscription_c_callback<const RX_BUF: usize>(
289        &mut self,
290        node_id: Option<super::node_record::NodeId>,
291        topic_name: &str,
292        type_name: &str,
293        type_hash: &str,
294        qos: QoSProfile,
295        callback: RawSubscriptionCallback,
296        context: *mut core::ffi::c_void,
297        group: Option<&str>,
298        rx_buffer_hint: usize,
299    ) -> Result<HandleId, NodeError>;
300
301    /// The FFI entry point; see `Executor::add_arena_subscription_c_callback_with_capture` in `spin.rs`.
302    #[allow(clippy::too_many_arguments)]
303    fn add_arena_subscription_c_callback_with_capture<const RX_BUF: usize>(
304        &mut self,
305        node_id: Option<super::node_record::NodeId>,
306        topic_name: &str,
307        type_name: &str,
308        type_hash: &str,
309        qos: QoSProfile,
310        callback: RawSubscriptionCallback,
311        context: *mut core::ffi::c_void,
312        group: Option<&str>,
313        rx_buffer_hint: usize,
314        capture: Option<&[u8]>,
315        capture_drop: Option<unsafe extern "C" fn(*mut core::ffi::c_void)>,
316    ) -> Result<HandleId, NodeError>;
317
318    /// The FFI entry point; see `Executor::add_arena_subscription_c_info_callback` in `spin.rs`.
319    #[allow(clippy::too_many_arguments)]
320    fn add_arena_subscription_c_info_callback<const RX_BUF: usize>(
321        &mut self,
322        node_id: Option<super::node_record::NodeId>,
323        topic_name: &str,
324        type_name: &str,
325        type_hash: &str,
326        qos: QoSProfile,
327        callback: RawSubscriptionInfoCallback,
328        context: *mut core::ffi::c_void,
329        rx_buffer_hint: usize,
330    ) -> Result<HandleId, NodeError>;
331
332    /// The FFI entry point; see `Executor::add_arena_subscription_c_typed_callback` in `spin.rs`.
333    #[allow(clippy::too_many_arguments)]
334    unsafe fn add_arena_subscription_c_typed_callback<const RX_BUF: usize>(
335        &mut self,
336        node_id: Option<super::node_record::NodeId>,
337        topic_name: &str,
338        type_name: &str,
339        type_hash: &str,
340        qos: QoSProfile,
341        msg: core::ptr::NonNull<core::ffi::c_void>,
342        deserialize: RawMessageDeserializeFn,
343        callback: TypedSubscriptionCallback,
344        context: *mut core::ffi::c_void,
345        group: Option<&str>,
346        rx_buffer_hint: usize,
347    ) -> Result<HandleId, NodeError>;
348
349    /// The FFI entry point; see `Executor::add_arena_subscription_c_validated_callback` in `spin.rs`.
350    #[cfg(feature = "safety-e2e")]
351    #[allow(clippy::too_many_arguments)]
352    fn add_arena_subscription_c_validated_callback<const RX_BUF: usize>(
353        &mut self,
354        node_id: Option<super::node_record::NodeId>,
355        topic_name: &str,
356        type_name: &str,
357        type_hash: &str,
358        qos: QoSProfile,
359        callback: super::types::RawSubscriptionSafetyCallback,
360        context: *mut core::ffi::c_void,
361        rx_buffer_hint: usize,
362    ) -> Result<HandleId, NodeError>;
363
364    /// The FFI entry point; see `Executor::add_on_shutdown_callback` in `spin.rs`.
365    unsafe fn add_on_shutdown_callback(
366        &mut self,
367        callback: super::types::ShutdownCallbackFn,
368        context: *mut core::ffi::c_void,
369    ) -> Result<super::types::ShutdownCallbackHandle, NodeError>;
370
371    /// The FFI entry point; see `Executor::add_pre_shutdown_callback` in `spin.rs`.
372    unsafe fn add_pre_shutdown_callback(
373        &mut self,
374        callback: super::types::ShutdownCallbackFn,
375        context: *mut core::ffi::c_void,
376    ) -> Result<super::types::ShutdownCallbackHandle, NodeError>;
377
378    /// The FFI entry point; see `Executor::remove_pre_shutdown_callback` in `spin.rs`.
379    fn remove_pre_shutdown_callback(
380        &mut self,
381        handle: super::types::ShutdownCallbackHandle,
382    ) -> bool;
383
384    /// The FFI entry point; see `Executor::remove_on_shutdown_callback` in `spin.rs`.
385    fn remove_on_shutdown_callback(&mut self, handle: super::types::ShutdownCallbackHandle)
386    -> bool;
387
388    /// The FFI entry point; see `Executor::from_session_ptr_in` in `spin.rs`.
389    unsafe fn from_session_ptr_in(
390        session_ptr: *mut session::ConcreteSession,
391        backing: &'s mut [MaybeUninit<u64>],
392        sizing: super::storage::ExecutorSizing,
393    ) -> Self;
394
395    /// The FFI entry point; see `Executor::open_multi_in` in `spin.rs`.
396    #[cfg(feature = "rmw-cffi")]
397    unsafe fn open_multi_in(
398        specs: &[SessionSpec<'_>],
399        backing: &'s mut [MaybeUninit<u64>],
400        sizing: super::storage::ExecutorSizing,
401    ) -> Result<Self, NodeError>;
402
403    /// The FFI entry point; see `Executor::open_with_session_handle_in` in `spin.rs`.
404    unsafe fn open_with_session_handle_in(
405        handle: SessionHandle,
406        backing: &'s mut [MaybeUninit<u64>],
407        sizing: super::storage::ExecutorSizing,
408    ) -> Self;
409
410    /// The FFI entry point; see `Executor::register_service_client_raw_sized` in `spin.rs`.
411    #[allow(clippy::too_many_arguments)]
412    fn register_service_client_raw_sized<const REPLY_BUF: usize>(
413        &mut self,
414        service_name: &str,
415        service_type: &str,
416        service_hash: &str,
417        qos: QoSProfile,
418        callback: Option<RawResponseCallback>,
419        context: *mut core::ffi::c_void,
420    ) -> Result<HandleId, NodeError>;
421
422    /// The FFI entry point; see `Executor::register_service_client_raw_capturing` in `spin.rs`.
423    #[allow(clippy::too_many_arguments)]
424    fn register_service_client_raw_capturing<const REPLY_BUF: usize>(
425        &mut self,
426        node_id: Option<super::node_record::NodeId>,
427        service_name: &str,
428        service_type: &str,
429        service_hash: &str,
430        qos: QoSProfile,
431        callback: Option<RawResponseCallback>,
432        capture: Option<&[u8]>,
433    ) -> Result<HandleId, NodeError>;
434
435    /// The FFI entry point; see `Executor::register_service_raw_capturing` in `spin.rs`.
436    #[allow(clippy::too_many_arguments)]
437    fn register_service_raw_capturing<const REQ_BUF: usize, const REPLY_BUF: usize>(
438        &mut self,
439        node_id: Option<super::node_record::NodeId>,
440        service_name: &str,
441        service_type: &str,
442        service_hash: &str,
443        qos: QoSProfile,
444        callback: RawServiceCallback,
445        capture: Option<&[u8]>,
446        capture_drop: Option<unsafe extern "C" fn(*mut core::ffi::c_void)>,
447    ) -> Result<HandleId, NodeError>;
448
449    /// The FFI entry point; see `Executor::register_service_raw_sized` in `spin.rs`.
450    #[allow(clippy::too_many_arguments)]
451    fn register_service_raw_sized<const REQ_BUF: usize, const REPLY_BUF: usize>(
452        &mut self,
453        service_name: &str,
454        service_type: &str,
455        service_hash: &str,
456        qos: QoSProfile,
457        callback: RawServiceCallback,
458        context: *mut core::ffi::c_void,
459    ) -> Result<HandleId, NodeError>;
460
461    /// The FFI entry point; see `Executor::register_timer_c_capturing` in `spin.rs`.
462    fn register_timer_c_capturing(
463        &mut self,
464        node_id: Option<super::node_record::NodeId>,
465        period: TimerDuration,
466        source: TimerClockSource,
467        callback: unsafe extern "C" fn(*mut core::ffi::c_void),
468        capture: Option<&[u8]>,
469        capture_drop: Option<unsafe extern "C" fn(*mut core::ffi::c_void)>,
470    ) -> Result<HandleId, NodeError>;
471
472    /// The FFI entry point; see `Executor::register_timer_c_capturing_with_info` in `spin.rs`.
473    #[allow(clippy::too_many_arguments)]
474    fn register_timer_c_capturing_with_info<I>(
475        &mut self,
476        node_id: Option<super::node_record::NodeId>,
477        period: TimerDuration,
478        source: TimerClockSource,
479        autostart: bool,
480        group: Option<&str>,
481        callback: unsafe extern "C" fn(*const I, *mut core::ffi::c_void),
482        capture: Option<&[u8]>,
483        capture_drop: Option<unsafe extern "C" fn(*mut core::ffi::c_void)>,
484    ) -> Result<HandleId, NodeError>
485    where
486        I: From<TimerCallInfo> + 'static;
487
488    /// The FFI entry point; see `Executor::release_action_client_raw` in `action.rs`.
489    unsafe fn release_action_client_raw(&mut self, entry_index: usize) -> bool;
490
491    /// The FFI entry point; see `Executor::release_action_server_raw` in `action.rs`.
492    unsafe fn release_action_server_raw(&mut self, handle: &ActionServerRawHandle) -> bool;
493
494    /// The FFI entry point; see `Executor::release_node` in `spin.rs`.
495    unsafe fn release_node(&mut self, node: crate::executor::NodeId) -> usize;
496
497    /// The FFI entry point; see `Executor::release_service` in `spin.rs`.
498    unsafe fn release_service(&mut self, handle: HandleId) -> bool;
499
500    /// The FFI entry point; see `Executor::release_service_client` in `spin.rs`.
501    unsafe fn release_service_client(&mut self, handle: HandleId) -> bool;
502
503    /// The FFI entry point; see `Executor::release_subscription` in `spin.rs`.
504    unsafe fn release_subscription(&mut self, handle: HandleId) -> bool;
505
506    /// The FFI entry point; see `Executor::release_timer` in `spin.rs`.
507    unsafe fn release_timer(&mut self, handle: HandleId) -> bool;
508
509    /// The FFI entry point; see `Executor::retarget_action_client_raw` in `action.rs`.
510    unsafe fn retarget_action_client_raw(
511        &mut self,
512        entry_index: usize,
513        context: *mut core::ffi::c_void,
514    ) -> bool;
515
516    /// The FFI entry point; see `Executor::retarget_action_server_raw` in `action.rs`.
517    unsafe fn retarget_action_server_raw(
518        &mut self,
519        handle: &ActionServerRawHandle,
520        context: *mut core::ffi::c_void,
521    ) -> bool;
522
523    /// The FFI entry point; see `Executor::service_client_handle` in `spin.rs`.
524    #[doc(hidden)]
525    unsafe fn service_client_handle(
526        &self,
527        entry_index: usize,
528    ) -> Option<&session::RmwServiceClient>;
529
530    /// The FFI entry point; see `Executor::service_server_handle` in `spin.rs`.
531    #[doc(hidden)]
532    unsafe fn service_server_handle(
533        &self,
534        entry_index: usize,
535    ) -> Option<&session::RmwServiceServer>;
536
537    /// The FFI entry point; see `Executor::set_park_primitive` in `spin.rs`.
538    fn set_park_primitive(
539        &mut self,
540        park: ParkUntilFn,
541        ctx: *mut core::ffi::c_void,
542        granularity_us: u64,
543    );
544
545    /// The FFI entry point; see `Executor::set_wake_hook` in `spin.rs`.
546    fn set_wake_hook(&mut self, hook: Option<WakeHookFn>, ctx: *mut core::ffi::c_void) -> bool;
547
548    /// The FFI entry point; see `Executor::subscription_handle` in `spin.rs`.
549    #[doc(hidden)]
550    unsafe fn subscription_handle(&self, entry_index: usize) -> Option<&session::RmwSubscriber>;
551
552    /// The FFI entry point; see `Executor::subscription_handle_mut` in `spin.rs`.
553    #[doc(hidden)]
554    unsafe fn subscription_handle_mut(
555        &mut self,
556        entry_index: usize,
557    ) -> Option<&mut session::RmwSubscriber>;
558
559    /// The FFI entry point; see `Executor::wake_raw_ptr` in `spin.rs`.
560    #[cfg(all(feature = "alloc", feature = "rmw-cffi"))]
561    fn wake_raw_ptr(&self) -> *mut core::ffi::c_void;
562
563    /// The FFI entry point; see `Executor::enter_spin_loop` in `spin.rs`.
564    fn enter_spin_loop(&self);
565
566    /// The FFI entry point; see `Executor::exit_spin_loop` in `spin.rs`.
567    fn exit_spin_loop(&self);
568
569    /// The FFI entry point; see `Executor::exec_lock` in `spin.rs`.
570    fn exec_lock(&self) -> Option<super::exec_lock::ExecLock>;
571
572    /// The FFI entry point; see `Executor::node_session_mut` in `spin.rs`.
573    fn node_session_mut(
574        &mut self,
575        node_id: super::node_record::NodeId,
576    ) -> Option<&mut session::ConcreteSession>;
577
578    /// The FFI entry point; see `Executor::register_action_client_raw` in `action.rs`.
579    #[doc(hidden)]
580    #[allow(clippy::too_many_arguments)]
581    fn register_action_client_raw(
582        &mut self,
583        spec: RawActionClientSpec<'_>,
584    ) -> Result<ActionClientRawHandle, NodeError>;
585
586    /// The FFI entry point; see `Executor::register_action_server_raw` in `action.rs`.
587    #[doc(hidden)]
588    #[allow(clippy::too_many_arguments)]
589    fn register_action_server_raw(
590        &mut self,
591        spec: RawActionServerSpec<'_>,
592    ) -> Result<ActionServerRawHandle, NodeError>;
593
594    /// The FFI entry point; see `Executor::install_wake_signal_on_primary` in `spin.rs`.
595    #[cfg(all(feature = "alloc", feature = "rmw-cffi"))]
596    fn install_wake_signal_on_primary(&mut self);
597
598    /// The FFI entry point; see `Executor::set_entry_owner` in `spin.rs`.
599    fn set_entry_owner(&mut self, id: HandleId, node: crate::executor::NodeId) -> bool;
600
601    /// The FFI entry point; see `Executor::set_primary_identity` in `spin.rs`.
602    fn set_primary_identity(&mut self, rmw_name: &str, locator: &str);
603
604    /// The FFI entry point; see `Executor::session_io_failures` in `spin.rs`.
605    fn session_io_failures(&self) -> u32;
606
607    /// The FFI entry point; see `Executor::timer_elapsed_us` in `spin.rs`.
608    fn timer_elapsed_us(&self, id: HandleId) -> Option<u64>;
609
610    /// The FFI entry point; see `Executor::timer_is_ready` in `spin.rs`.
611    fn timer_is_ready(&self, id: HandleId) -> Option<bool>;
612
613    /// The FFI entry point; see `Executor::exchange_timer_period_us` in `spin.rs`.
614    fn exchange_timer_period_us(&mut self, id: HandleId, new_period_us: u64) -> Option<u64>;
615
616    /// The FFI entry point; see `Executor::action_client_core_mut` in `spin.rs`.
617    #[doc(hidden)]
618    unsafe fn action_client_core_mut(
619        &mut self,
620        entry_index: usize,
621    ) -> Option<&mut super::action_core::ActionClientCore>;
622
623    /// The FFI entry point; see `Executor::register_service_client_raw_sized_on` in `spin.rs`.
624    #[allow(clippy::too_many_arguments)]
625    fn register_service_client_raw_sized_on<const REPLY_BUF: usize>(
626        &mut self,
627        node_id: super::node_record::NodeId,
628        service_name: &str,
629        service_type: &str,
630        service_hash: &str,
631        qos: QoSProfile,
632        callback: Option<RawResponseCallback>,
633        context: *mut core::ffi::c_void,
634    ) -> Result<HandleId, NodeError>;
635
636    /// The FFI entry point; see `Executor::register_service_raw_sized_on` in `spin.rs`.
637    #[allow(clippy::too_many_arguments)]
638    fn register_service_raw_sized_on<const REQ_BUF: usize, const REPLY_BUF: usize>(
639        &mut self,
640        node_id: super::node_record::NodeId,
641        service_name: &str,
642        service_type: &str,
643        service_hash: &str,
644        qos: QoSProfile,
645        callback: RawServiceCallback,
646        context: *mut core::ffi::c_void,
647    ) -> Result<HandleId, NodeError>;
648
649    /// The FFI entry point; see `Executor::service_client_entry_mut` in `spin.rs`.
650    unsafe fn service_client_entry_mut(
651        &mut self,
652        entry_index: usize,
653    ) -> Option<&mut super::arena::ServiceClientRawArenaEntry<{ crate::config::DEFAULT_RX_BUF_SIZE }>>;
654
655    /// The FFI entry point; see `Executor::from_session_ptr` in `spin.rs`.
656    #[cfg(feature = "alloc")]
657    unsafe fn from_session_ptr(session_ptr: *mut session::ConcreteSession) -> Executor<'static>;
658
659    /// The FFI entry point; see `Executor::from_session_in` in `spin.rs`.
660    unsafe fn from_session_in(
661        session: session::ConcreteSession,
662        backing: &'s mut [MaybeUninit<u64>],
663        sizing: super::storage::ExecutorSizing,
664    ) -> Self;
665
666    /// The FFI entry point; see `Executor::open_with_session_in` in `spin.rs`.
667    unsafe fn open_with_session_in(
668        session: *mut session::ConcreteSession,
669        backing: &'s mut [MaybeUninit<u64>],
670        sizing: super::storage::ExecutorSizing,
671    ) -> Self;
672
673    /// The FFI entry point; see `Executor::open_with_session_slot` in `spin.rs`.
674    #[cfg(feature = "alloc")]
675    unsafe fn open_with_session_slot(
676        session: *mut session::ConcreteSession,
677        slot: &'s mut super::SchedTaskExecutorBackingSlot,
678    ) -> Self;
679
680    /// The FFI entry point; see `Executor::open_with_session_handle_slot` in `spin.rs`.
681    #[cfg(feature = "alloc")]
682    unsafe fn open_with_session_handle_slot(
683        handle: SessionHandle,
684        slot: &'s mut super::SchedTaskExecutorBackingSlot,
685    ) -> Self;
686
687    /// The FFI entry point; see `Executor::detach_action_client_raw` in `action.rs`.
688    unsafe fn detach_action_client_raw(&mut self, entry_index: usize) -> bool;
689
690    /// The FFI entry point; see `Executor::detach_action_server_raw` in `action.rs`.
691    unsafe fn detach_action_server_raw(&mut self, handle: &ActionServerRawHandle) -> bool;
692
693    /// The FFI entry point; see `Executor::detach_action_server_raw_sized` in `action.rs`.
694    unsafe fn detach_action_server_raw_sized<
695        const GOAL_BUF: usize,
696        const RESULT_BUF: usize,
697        const FEEDBACK_BUF: usize,
698        const MAX_GOALS: usize,
699    >(
700        &mut self,
701        entry_index: usize,
702    ) -> bool;
703
704    /// The FFI entry point; see `Executor::release_action_client_raw_sized` in `action.rs`.
705    unsafe fn release_action_client_raw_sized<
706        const GOAL_BUF: usize,
707        const RESULT_BUF: usize,
708        const FEEDBACK_BUF: usize,
709    >(
710        &mut self,
711        entry_index: usize,
712    ) -> bool;
713
714    /// The FFI entry point; see `Executor::release_action_server_raw_sized` in `action.rs`.
715    unsafe fn release_action_server_raw_sized<
716        const GOAL_BUF: usize,
717        const RESULT_BUF: usize,
718        const FEEDBACK_BUF: usize,
719        const MAX_GOALS: usize,
720    >(
721        &mut self,
722        entry_index: usize,
723    ) -> bool;
724
725    /// The FFI entry point; see `Executor::register_service_raw` in `spin.rs`.
726    fn register_service_raw(
727        &mut self,
728        service_name: &str,
729        service_type: &str,
730        service_hash: &str,
731        callback: RawServiceCallback,
732        context: *mut core::ffi::c_void,
733    ) -> Result<HandleId, NodeError>;
734
735    /// The FFI entry point; see `Executor::register_service_client_raw` in `spin.rs`.
736    fn register_service_client_raw(
737        &mut self,
738        service_name: &str,
739        service_type: &str,
740        service_hash: &str,
741        callback: Option<RawResponseCallback>,
742        context: *mut core::ffi::c_void,
743    ) -> Result<HandleId, NodeError>;
744
745    /// The FFI entry point; see `Executor::register_action_client_core` in `action.rs`.
746    #[doc(hidden)]
747    fn register_action_client_core<
748        const GOAL_BUF: usize,
749        const RESULT_BUF: usize,
750        const FEEDBACK_BUF: usize,
751    >(
752        &mut self,
753        core: ActionClientCore<GOAL_BUF, RESULT_BUF, FEEDBACK_BUF>,
754        goal_response_callback: Option<RawGoalResponseCallback>,
755        feedback_callback: Option<RawFeedbackCallback>,
756        result_callback: Option<RawResultCallback>,
757        cancel_response_callback: Option<RawCancelResponseCallback>,
758        context: *mut core::ffi::c_void,
759    ) -> Result<ActionClientRawHandle, NodeError>;
760
761    /// The FFI entry point; see `Executor::release_guard_condition` in `spin.rs`.
762    unsafe fn release_guard_condition(&mut self, handle: HandleId) -> bool;
763}
764
765impl<'s> ExecutorFfi<'s> for Executor<'s> {
766    #[cfg(all(feature = "param-store", feature = "alloc"))]
767    #[inline]
768    #[cfg(feature = "param-store")]
769    fn argv_param_overrides_on(
770        &self,
771        node: super::node_record::NodeId,
772    ) -> impl Iterator<Item = (&str, nros_params::ParameterValue)> + '_ {
773        Executor::argv_param_overrides_on(self, node)
774    }
775
776    #[cfg(all(feature = "param-store", feature = "alloc"))]
777    #[inline]
778    #[cfg(feature = "param-store")]
779    fn for_each_argv_param_override_on(
780        &self,
781        node: super::node_record::NodeId,
782        f: impl FnMut(&str, &nros_params::ParameterValue),
783    ) -> usize {
784        Executor::for_each_argv_param_override_on(self, node, f)
785    }
786
787    #[inline]
788    #[cfg(feature = "param-store")]
789    fn declare_parameter_on(
790        &mut self,
791        node: super::node_record::NodeId,
792        name: &str,
793        value: nros_params::ParameterValue,
794    ) -> bool {
795        Executor::declare_parameter_on(self, node, name, value)
796    }
797
798    #[inline]
799    #[cfg(feature = "param-store")]
800    fn declare_parameter_on_ref(
801        &mut self,
802        node: super::node_record::NodeId,
803        name: &str,
804        value: &nros_params::ParameterValue,
805    ) -> bool {
806        Executor::declare_parameter_on_ref(self, node, name, value)
807    }
808
809    #[inline]
810    #[cfg(feature = "param-store")]
811    fn seed_launch_parameter_on_ref(
812        &mut self,
813        node: super::node_record::NodeId,
814        name: &str,
815        value: &nros_params::ParameterValue,
816    ) -> bool {
817        Executor::seed_launch_parameter_on_ref(self, node, name, value)
818    }
819
820    #[inline]
821    #[cfg(feature = "param-store")]
822    fn adopt_launch_seed_on(
823        &mut self,
824        node: super::node_record::NodeId,
825        name: &str,
826        param_type: nros_params::ParameterType,
827        descriptor: Option<&nros_params::ParameterDescriptor>,
828    ) -> Option<Result<(), nros_params::DeclarationError>> {
829        Executor::adopt_launch_seed_on(self, node, name, param_type, descriptor)
830    }
831
832    #[inline]
833    #[cfg(feature = "param-store")]
834    fn declare_parameter_with_descriptor_on(
835        &mut self,
836        node: super::node_record::NodeId,
837        name: &str,
838        value: nros_params::ParameterValue,
839        descriptor: nros_params::ParameterDescriptor,
840    ) -> bool {
841        Executor::declare_parameter_with_descriptor_on(self, node, name, value, descriptor)
842    }
843
844    #[inline]
845    #[cfg(feature = "param-store")]
846    fn report_parameter_refused(&self, node: super::node_record::NodeId, name: &str) -> bool {
847        Executor::report_parameter_refused(self, node, name)
848    }
849
850    #[inline]
851    #[cfg(feature = "param-store")]
852    fn set_parameter_on(
853        &mut self,
854        node: super::node_record::NodeId,
855        name: &str,
856        value: nros_params::ParameterValue,
857    ) -> Result<(), nros_params::ParameterError> {
858        Executor::set_parameter_on(self, node, name, value)
859    }
860
861    #[inline]
862    #[cfg(feature = "param-store")]
863    fn set_parameter_on_ref(
864        &mut self,
865        node: super::node_record::NodeId,
866        name: &str,
867        value: &nros_params::ParameterValue,
868    ) -> Result<(), nros_params::ParameterError> {
869        Executor::set_parameter_on_ref(self, node, name, value)
870    }
871
872    #[inline]
873    #[cfg(feature = "param-store")]
874    fn set_parameter_local_on(
875        &mut self,
876        node: super::node_record::NodeId,
877        name: &str,
878        value: nros_params::ParameterValue,
879    ) -> Result<(), nros_params::ParameterError> {
880        Executor::set_parameter_local_on(self, node, name, value)
881    }
882
883    #[cfg(feature = "param-services")]
884    #[inline]
885    #[cfg(feature = "param-store")]
886    fn disable_parameter_events_on(&mut self, node: super::node_record::NodeId) {
887        Executor::disable_parameter_events_on(self, node)
888    }
889
890    #[cfg(feature = "param-services")]
891    #[inline]
892    #[cfg(feature = "param-store")]
893    fn enable_parameter_events_on(
894        &mut self,
895        node: super::node_record::NodeId,
896    ) -> Result<(), NodeError> {
897        Executor::enable_parameter_events_on(self, node)
898    }
899
900    #[inline]
901    #[cfg(feature = "param-store")]
902    fn delete_parameters_on_not_set_on(&mut self, node: super::node_record::NodeId, on: bool) {
903        Executor::delete_parameters_on_not_set_on(self, node, on)
904    }
905
906    #[inline]
907    #[cfg(feature = "param-store")]
908    fn allow_undeclared_parameters_on(&mut self, node: super::node_record::NodeId, allow: bool) {
909        Executor::allow_undeclared_parameters_on(self, node, allow)
910    }
911
912    #[inline]
913    #[cfg(feature = "param-store")]
914    fn get_parameter_on(
915        &self,
916        node: super::node_record::NodeId,
917        name: &str,
918    ) -> Option<&nros_params::ParameterValue> {
919        Executor::get_parameter_on(self, node, name)
920    }
921
922    #[inline]
923    #[cfg(feature = "param-store")]
924    fn parameter_on<'a, T: nros_params::ParameterVariant>(
925        &'a mut self,
926        node: super::node_record::NodeId,
927        name: &'a str,
928    ) -> Result<nros_params::ParameterBuilder<'a, 's, T>, NodeError> {
929        Executor::parameter_on::<T>(self, node, name)
930    }
931
932    #[inline]
933    #[cfg(feature = "param-store")]
934    fn set_parameter_description_on(
935        &mut self,
936        node: super::node_record::NodeId,
937        name: &str,
938        description: &str,
939        additional_constraints: &str,
940    ) -> bool {
941        Executor::set_parameter_description_on(
942            self,
943            node,
944            name,
945            description,
946            additional_constraints,
947        )
948    }
949
950    #[inline]
951    #[cfg(feature = "param-store")]
952    fn set_parameter_read_only_on(
953        &mut self,
954        node: super::node_record::NodeId,
955        name: &str,
956        read_only: bool,
957    ) -> bool {
958        Executor::set_parameter_read_only_on(self, node, name, read_only)
959    }
960
961    #[inline]
962    #[cfg(feature = "param-store")]
963    fn set_parameter_integer_range_on(
964        &mut self,
965        node: super::node_record::NodeId,
966        name: &str,
967        min: i64,
968        max: i64,
969        step: i64,
970    ) -> bool {
971        Executor::set_parameter_integer_range_on(self, node, name, min, max, step)
972    }
973
974    #[inline]
975    #[cfg(feature = "param-store")]
976    fn set_parameter_float_range_on(
977        &mut self,
978        node: super::node_record::NodeId,
979        name: &str,
980        min: f64,
981        max: f64,
982        step: f64,
983    ) -> bool {
984        Executor::set_parameter_float_range_on(self, node, name, min, max, step)
985    }
986
987    #[inline]
988    #[cfg(feature = "param-store")]
989    fn describe_parameter_on(
990        &self,
991        node: super::node_record::NodeId,
992        name: &str,
993    ) -> Option<&nros_params::ParameterDescriptor> {
994        Executor::describe_parameter_on(self, node, name)
995    }
996
997    #[inline]
998    #[cfg(feature = "param-store")]
999    fn get_parameter_type_on(
1000        &self,
1001        node: super::node_record::NodeId,
1002        name: &str,
1003    ) -> Option<nros_params::ParameterType> {
1004        Executor::get_parameter_type_on(self, node, name)
1005    }
1006
1007    #[inline]
1008    #[cfg(feature = "param-store")]
1009    fn list_parameters_on<'p>(
1010        &'p self,
1011        node: super::node_record::NodeId,
1012        prefix: &'p str,
1013    ) -> impl Iterator<Item = &'p str> {
1014        Executor::list_parameters_on(self, node, prefix)
1015    }
1016
1017    #[inline]
1018    #[cfg(feature = "param-store")]
1019    fn declared_parameter_count_on(&self, node: super::node_record::NodeId) -> usize {
1020        Executor::declared_parameter_count_on(self, node)
1021    }
1022
1023    #[inline]
1024    #[cfg(feature = "param-store")]
1025    fn set_parameters_atomically_on<'x, I>(
1026        &mut self,
1027        node: super::node_record::NodeId,
1028        items: I,
1029    ) -> Result<(), nros_params::ParameterError>
1030    where
1031        I: Iterator<Item = Option<(&'x str, nros_params::ParameterValue)>> + Clone,
1032    {
1033        Executor::set_parameters_atomically_on::<I>(self, node, items)
1034    }
1035
1036    #[inline]
1037    #[cfg(feature = "param-store")]
1038    fn set_parameters_atomically_with_on<'x>(
1039        &mut self,
1040        node: super::node_record::NodeId,
1041        count: usize,
1042        fill: impl FnMut(usize, &mut nros_params::ParameterValue) -> Option<&'x str>,
1043    ) -> Result<(), nros_params::ParameterError> {
1044        Executor::set_parameters_atomically_with_on(self, node, count, fill)
1045    }
1046
1047    #[inline]
1048    #[cfg(feature = "param-store")]
1049    fn undeclare_parameter_on(&mut self, node: super::node_record::NodeId, name: &str) -> bool {
1050        Executor::undeclare_parameter_on(self, node, name)
1051    }
1052
1053    #[inline]
1054    #[cfg(feature = "param-store")]
1055    fn add_on_set_parameters_callback_on(
1056        &mut self,
1057        node: super::node_record::NodeId,
1058        callback: nros_params::OnSetParameterFn,
1059        ctx: nros_params::OnSetContext,
1060    ) -> Option<nros_params::OnSetParameterHandle> {
1061        Executor::add_on_set_parameters_callback_on(self, node, callback, ctx)
1062    }
1063
1064    #[inline]
1065    #[cfg(feature = "param-store")]
1066    fn use_undeclared_parameters_on(
1067        &mut self,
1068        node: super::node_record::NodeId,
1069    ) -> Result<nros_params::Parameters<'_, 's>, NodeError> {
1070        Executor::use_undeclared_parameters_on(self, node)
1071    }
1072
1073    #[allow(clippy::too_many_arguments)]
1074    #[inline]
1075    fn add_arena_subscription_c_callback<const RX_BUF: usize>(
1076        &mut self,
1077        node_id: Option<super::node_record::NodeId>,
1078        topic_name: &str,
1079        type_name: &str,
1080        type_hash: &str,
1081        qos: QoSProfile,
1082        callback: RawSubscriptionCallback,
1083        context: *mut core::ffi::c_void,
1084        group: Option<&str>,
1085        rx_buffer_hint: usize,
1086    ) -> Result<HandleId, NodeError> {
1087        Executor::add_arena_subscription_c_callback::<RX_BUF>(
1088            self,
1089            node_id,
1090            topic_name,
1091            type_name,
1092            type_hash,
1093            qos,
1094            callback,
1095            context,
1096            group,
1097            rx_buffer_hint,
1098        )
1099    }
1100
1101    #[allow(clippy::too_many_arguments)]
1102    #[inline]
1103    fn add_arena_subscription_c_callback_with_capture<const RX_BUF: usize>(
1104        &mut self,
1105        node_id: Option<super::node_record::NodeId>,
1106        topic_name: &str,
1107        type_name: &str,
1108        type_hash: &str,
1109        qos: QoSProfile,
1110        callback: RawSubscriptionCallback,
1111        context: *mut core::ffi::c_void,
1112        group: Option<&str>,
1113        rx_buffer_hint: usize,
1114        capture: Option<&[u8]>,
1115        capture_drop: Option<unsafe extern "C" fn(*mut core::ffi::c_void)>,
1116    ) -> Result<HandleId, NodeError> {
1117        Executor::add_arena_subscription_c_callback_with_capture::<RX_BUF>(
1118            self,
1119            node_id,
1120            topic_name,
1121            type_name,
1122            type_hash,
1123            qos,
1124            callback,
1125            context,
1126            group,
1127            rx_buffer_hint,
1128            capture,
1129            capture_drop,
1130        )
1131    }
1132
1133    #[allow(clippy::too_many_arguments)]
1134    #[inline]
1135    fn add_arena_subscription_c_info_callback<const RX_BUF: usize>(
1136        &mut self,
1137        node_id: Option<super::node_record::NodeId>,
1138        topic_name: &str,
1139        type_name: &str,
1140        type_hash: &str,
1141        qos: QoSProfile,
1142        callback: RawSubscriptionInfoCallback,
1143        context: *mut core::ffi::c_void,
1144        rx_buffer_hint: usize,
1145    ) -> Result<HandleId, NodeError> {
1146        Executor::add_arena_subscription_c_info_callback::<RX_BUF>(
1147            self,
1148            node_id,
1149            topic_name,
1150            type_name,
1151            type_hash,
1152            qos,
1153            callback,
1154            context,
1155            rx_buffer_hint,
1156        )
1157    }
1158
1159    #[allow(clippy::too_many_arguments)]
1160    #[inline]
1161    unsafe fn add_arena_subscription_c_typed_callback<const RX_BUF: usize>(
1162        &mut self,
1163        node_id: Option<super::node_record::NodeId>,
1164        topic_name: &str,
1165        type_name: &str,
1166        type_hash: &str,
1167        qos: QoSProfile,
1168        msg: core::ptr::NonNull<core::ffi::c_void>,
1169        deserialize: RawMessageDeserializeFn,
1170        callback: TypedSubscriptionCallback,
1171        context: *mut core::ffi::c_void,
1172        group: Option<&str>,
1173        rx_buffer_hint: usize,
1174    ) -> Result<HandleId, NodeError> {
1175        unsafe {
1176            Executor::add_arena_subscription_c_typed_callback::<RX_BUF>(
1177                self,
1178                node_id,
1179                topic_name,
1180                type_name,
1181                type_hash,
1182                qos,
1183                msg,
1184                deserialize,
1185                callback,
1186                context,
1187                group,
1188                rx_buffer_hint,
1189            )
1190        }
1191    }
1192
1193    #[cfg(feature = "safety-e2e")]
1194    #[allow(clippy::too_many_arguments)]
1195    #[inline]
1196    fn add_arena_subscription_c_validated_callback<const RX_BUF: usize>(
1197        &mut self,
1198        node_id: Option<super::node_record::NodeId>,
1199        topic_name: &str,
1200        type_name: &str,
1201        type_hash: &str,
1202        qos: QoSProfile,
1203        callback: super::types::RawSubscriptionSafetyCallback,
1204        context: *mut core::ffi::c_void,
1205        rx_buffer_hint: usize,
1206    ) -> Result<HandleId, NodeError> {
1207        Executor::add_arena_subscription_c_validated_callback::<RX_BUF>(
1208            self,
1209            node_id,
1210            topic_name,
1211            type_name,
1212            type_hash,
1213            qos,
1214            callback,
1215            context,
1216            rx_buffer_hint,
1217        )
1218    }
1219
1220    #[inline]
1221    unsafe fn add_on_shutdown_callback(
1222        &mut self,
1223        callback: super::types::ShutdownCallbackFn,
1224        context: *mut core::ffi::c_void,
1225    ) -> Result<super::types::ShutdownCallbackHandle, NodeError> {
1226        unsafe { Executor::add_on_shutdown_callback(self, callback, context) }
1227    }
1228
1229    #[inline]
1230    unsafe fn add_pre_shutdown_callback(
1231        &mut self,
1232        callback: super::types::ShutdownCallbackFn,
1233        context: *mut core::ffi::c_void,
1234    ) -> Result<super::types::ShutdownCallbackHandle, NodeError> {
1235        unsafe { Executor::add_pre_shutdown_callback(self, callback, context) }
1236    }
1237
1238    #[inline]
1239    fn remove_pre_shutdown_callback(
1240        &mut self,
1241        handle: super::types::ShutdownCallbackHandle,
1242    ) -> bool {
1243        Executor::remove_pre_shutdown_callback(self, handle)
1244    }
1245
1246    #[inline]
1247    fn remove_on_shutdown_callback(
1248        &mut self,
1249        handle: super::types::ShutdownCallbackHandle,
1250    ) -> bool {
1251        Executor::remove_on_shutdown_callback(self, handle)
1252    }
1253
1254    #[inline]
1255    unsafe fn from_session_ptr_in(
1256        session_ptr: *mut session::ConcreteSession,
1257        backing: &'s mut [MaybeUninit<u64>],
1258        sizing: super::storage::ExecutorSizing,
1259    ) -> Self {
1260        unsafe { Executor::from_session_ptr_in(session_ptr, backing, sizing) }
1261    }
1262
1263    #[cfg(feature = "rmw-cffi")]
1264    #[inline]
1265    unsafe fn open_multi_in(
1266        specs: &[SessionSpec<'_>],
1267        backing: &'s mut [MaybeUninit<u64>],
1268        sizing: super::storage::ExecutorSizing,
1269    ) -> Result<Self, NodeError> {
1270        unsafe { Executor::open_multi_in(specs, backing, sizing) }
1271    }
1272
1273    #[inline]
1274    unsafe fn open_with_session_handle_in(
1275        handle: SessionHandle,
1276        backing: &'s mut [MaybeUninit<u64>],
1277        sizing: super::storage::ExecutorSizing,
1278    ) -> Self {
1279        unsafe { Executor::open_with_session_handle_in(handle, backing, sizing) }
1280    }
1281
1282    #[allow(clippy::too_many_arguments)]
1283    #[inline]
1284    fn register_service_client_raw_sized<const REPLY_BUF: usize>(
1285        &mut self,
1286        service_name: &str,
1287        service_type: &str,
1288        service_hash: &str,
1289        qos: QoSProfile,
1290        callback: Option<RawResponseCallback>,
1291        context: *mut core::ffi::c_void,
1292    ) -> Result<HandleId, NodeError> {
1293        Executor::register_service_client_raw_sized::<REPLY_BUF>(
1294            self,
1295            service_name,
1296            service_type,
1297            service_hash,
1298            qos,
1299            callback,
1300            context,
1301        )
1302    }
1303
1304    #[allow(clippy::too_many_arguments)]
1305    #[inline]
1306    fn register_service_client_raw_capturing<const REPLY_BUF: usize>(
1307        &mut self,
1308        node_id: Option<super::node_record::NodeId>,
1309        service_name: &str,
1310        service_type: &str,
1311        service_hash: &str,
1312        qos: QoSProfile,
1313        callback: Option<RawResponseCallback>,
1314        capture: Option<&[u8]>,
1315    ) -> Result<HandleId, NodeError> {
1316        Executor::register_service_client_raw_capturing::<REPLY_BUF>(
1317            self,
1318            node_id,
1319            service_name,
1320            service_type,
1321            service_hash,
1322            qos,
1323            callback,
1324            capture,
1325        )
1326    }
1327
1328    #[allow(clippy::too_many_arguments)]
1329    #[inline]
1330    fn register_service_raw_capturing<const REQ_BUF: usize, const REPLY_BUF: usize>(
1331        &mut self,
1332        node_id: Option<super::node_record::NodeId>,
1333        service_name: &str,
1334        service_type: &str,
1335        service_hash: &str,
1336        qos: QoSProfile,
1337        callback: RawServiceCallback,
1338        capture: Option<&[u8]>,
1339        capture_drop: Option<unsafe extern "C" fn(*mut core::ffi::c_void)>,
1340    ) -> Result<HandleId, NodeError> {
1341        Executor::register_service_raw_capturing::<REQ_BUF, REPLY_BUF>(
1342            self,
1343            node_id,
1344            service_name,
1345            service_type,
1346            service_hash,
1347            qos,
1348            callback,
1349            capture,
1350            capture_drop,
1351        )
1352    }
1353
1354    #[allow(clippy::too_many_arguments)]
1355    #[inline]
1356    fn register_service_raw_sized<const REQ_BUF: usize, const REPLY_BUF: usize>(
1357        &mut self,
1358        service_name: &str,
1359        service_type: &str,
1360        service_hash: &str,
1361        qos: QoSProfile,
1362        callback: RawServiceCallback,
1363        context: *mut core::ffi::c_void,
1364    ) -> Result<HandleId, NodeError> {
1365        Executor::register_service_raw_sized::<REQ_BUF, REPLY_BUF>(
1366            self,
1367            service_name,
1368            service_type,
1369            service_hash,
1370            qos,
1371            callback,
1372            context,
1373        )
1374    }
1375
1376    #[inline]
1377    fn register_timer_c_capturing(
1378        &mut self,
1379        node_id: Option<super::node_record::NodeId>,
1380        period: TimerDuration,
1381        source: TimerClockSource,
1382        callback: unsafe extern "C" fn(*mut core::ffi::c_void),
1383        capture: Option<&[u8]>,
1384        capture_drop: Option<unsafe extern "C" fn(*mut core::ffi::c_void)>,
1385    ) -> Result<HandleId, NodeError> {
1386        Executor::register_timer_c_capturing(
1387            self,
1388            node_id,
1389            period,
1390            source,
1391            callback,
1392            capture,
1393            capture_drop,
1394        )
1395    }
1396
1397    #[allow(clippy::too_many_arguments)]
1398    #[inline]
1399    fn register_timer_c_capturing_with_info<I>(
1400        &mut self,
1401        node_id: Option<super::node_record::NodeId>,
1402        period: TimerDuration,
1403        source: TimerClockSource,
1404        autostart: bool,
1405        group: Option<&str>,
1406        callback: unsafe extern "C" fn(*const I, *mut core::ffi::c_void),
1407        capture: Option<&[u8]>,
1408        capture_drop: Option<unsafe extern "C" fn(*mut core::ffi::c_void)>,
1409    ) -> Result<HandleId, NodeError>
1410    where
1411        I: From<TimerCallInfo> + 'static,
1412    {
1413        Executor::register_timer_c_capturing_with_info::<I>(
1414            self,
1415            node_id,
1416            period,
1417            source,
1418            autostart,
1419            group,
1420            callback,
1421            capture,
1422            capture_drop,
1423        )
1424    }
1425
1426    #[inline]
1427    unsafe fn release_action_client_raw(&mut self, entry_index: usize) -> bool {
1428        unsafe { Executor::release_action_client_raw(self, entry_index) }
1429    }
1430
1431    #[inline]
1432    unsafe fn release_action_server_raw(&mut self, handle: &ActionServerRawHandle) -> bool {
1433        unsafe { Executor::release_action_server_raw(self, handle) }
1434    }
1435
1436    #[inline]
1437    unsafe fn release_node(&mut self, node: crate::executor::NodeId) -> usize {
1438        unsafe { Executor::release_node(self, node) }
1439    }
1440
1441    #[inline]
1442    unsafe fn release_service(&mut self, handle: HandleId) -> bool {
1443        unsafe { Executor::release_service(self, handle) }
1444    }
1445
1446    #[inline]
1447    unsafe fn release_service_client(&mut self, handle: HandleId) -> bool {
1448        unsafe { Executor::release_service_client(self, handle) }
1449    }
1450
1451    #[inline]
1452    unsafe fn release_subscription(&mut self, handle: HandleId) -> bool {
1453        unsafe { Executor::release_subscription(self, handle) }
1454    }
1455
1456    #[inline]
1457    unsafe fn release_timer(&mut self, handle: HandleId) -> bool {
1458        unsafe { Executor::release_timer(self, handle) }
1459    }
1460
1461    #[inline]
1462    unsafe fn retarget_action_client_raw(
1463        &mut self,
1464        entry_index: usize,
1465        context: *mut core::ffi::c_void,
1466    ) -> bool {
1467        unsafe { Executor::retarget_action_client_raw(self, entry_index, context) }
1468    }
1469
1470    #[inline]
1471    unsafe fn retarget_action_server_raw(
1472        &mut self,
1473        handle: &ActionServerRawHandle,
1474        context: *mut core::ffi::c_void,
1475    ) -> bool {
1476        unsafe { Executor::retarget_action_server_raw(self, handle, context) }
1477    }
1478
1479    #[doc(hidden)]
1480    #[inline]
1481    unsafe fn service_client_handle(
1482        &self,
1483        entry_index: usize,
1484    ) -> Option<&session::RmwServiceClient> {
1485        unsafe { Executor::service_client_handle(self, entry_index) }
1486    }
1487
1488    #[doc(hidden)]
1489    #[inline]
1490    unsafe fn service_server_handle(
1491        &self,
1492        entry_index: usize,
1493    ) -> Option<&session::RmwServiceServer> {
1494        unsafe { Executor::service_server_handle(self, entry_index) }
1495    }
1496
1497    #[inline]
1498    fn set_park_primitive(
1499        &mut self,
1500        park: ParkUntilFn,
1501        ctx: *mut core::ffi::c_void,
1502        granularity_us: u64,
1503    ) {
1504        Executor::set_park_primitive(self, park, ctx, granularity_us)
1505    }
1506
1507    #[inline]
1508    fn set_wake_hook(&mut self, hook: Option<WakeHookFn>, ctx: *mut core::ffi::c_void) -> bool {
1509        Executor::set_wake_hook(self, hook, ctx)
1510    }
1511
1512    #[doc(hidden)]
1513    #[inline]
1514    unsafe fn subscription_handle(&self, entry_index: usize) -> Option<&session::RmwSubscriber> {
1515        unsafe { Executor::subscription_handle(self, entry_index) }
1516    }
1517
1518    #[doc(hidden)]
1519    #[inline]
1520    unsafe fn subscription_handle_mut(
1521        &mut self,
1522        entry_index: usize,
1523    ) -> Option<&mut session::RmwSubscriber> {
1524        unsafe { Executor::subscription_handle_mut(self, entry_index) }
1525    }
1526
1527    #[cfg(all(feature = "alloc", feature = "rmw-cffi"))]
1528    #[inline]
1529    fn wake_raw_ptr(&self) -> *mut core::ffi::c_void {
1530        Executor::wake_raw_ptr(self)
1531    }
1532
1533    #[inline]
1534    fn enter_spin_loop(&self) {
1535        Executor::enter_spin_loop(self)
1536    }
1537
1538    #[inline]
1539    fn exit_spin_loop(&self) {
1540        Executor::exit_spin_loop(self)
1541    }
1542
1543    #[inline]
1544    fn exec_lock(&self) -> Option<super::exec_lock::ExecLock> {
1545        Executor::exec_lock(self)
1546    }
1547
1548    #[inline]
1549    fn node_session_mut(
1550        &mut self,
1551        node_id: super::node_record::NodeId,
1552    ) -> Option<&mut session::ConcreteSession> {
1553        Executor::node_session_mut(self, node_id)
1554    }
1555
1556    #[doc(hidden)]
1557    #[allow(clippy::too_many_arguments)]
1558    #[inline]
1559    fn register_action_client_raw(
1560        &mut self,
1561        spec: RawActionClientSpec<'_>,
1562    ) -> Result<ActionClientRawHandle, NodeError> {
1563        Executor::register_action_client_raw(self, spec)
1564    }
1565
1566    #[doc(hidden)]
1567    #[allow(clippy::too_many_arguments)]
1568    #[inline]
1569    fn register_action_server_raw(
1570        &mut self,
1571        spec: RawActionServerSpec<'_>,
1572    ) -> Result<ActionServerRawHandle, NodeError> {
1573        Executor::register_action_server_raw(self, spec)
1574    }
1575
1576    #[cfg(all(feature = "alloc", feature = "rmw-cffi"))]
1577    #[inline]
1578    fn install_wake_signal_on_primary(&mut self) {
1579        Executor::install_wake_signal_on_primary(self)
1580    }
1581
1582    #[inline]
1583    fn set_entry_owner(&mut self, id: HandleId, node: crate::executor::NodeId) -> bool {
1584        Executor::set_entry_owner(self, id, node)
1585    }
1586
1587    #[inline]
1588    fn set_primary_identity(&mut self, rmw_name: &str, locator: &str) {
1589        Executor::set_primary_identity(self, rmw_name, locator)
1590    }
1591
1592    #[inline]
1593    fn session_io_failures(&self) -> u32 {
1594        Executor::session_io_failures(self)
1595    }
1596
1597    #[inline]
1598    fn timer_elapsed_us(&self, id: HandleId) -> Option<u64> {
1599        Executor::timer_elapsed_us(self, id)
1600    }
1601
1602    #[inline]
1603    fn timer_is_ready(&self, id: HandleId) -> Option<bool> {
1604        Executor::timer_is_ready(self, id)
1605    }
1606
1607    #[inline]
1608    fn exchange_timer_period_us(&mut self, id: HandleId, new_period_us: u64) -> Option<u64> {
1609        Executor::exchange_timer_period_us(self, id, new_period_us)
1610    }
1611
1612    #[doc(hidden)]
1613    #[inline]
1614    unsafe fn action_client_core_mut(
1615        &mut self,
1616        entry_index: usize,
1617    ) -> Option<&mut super::action_core::ActionClientCore> {
1618        unsafe { Executor::action_client_core_mut(self, entry_index) }
1619    }
1620
1621    #[allow(clippy::too_many_arguments)]
1622    #[inline]
1623    fn register_service_client_raw_sized_on<const REPLY_BUF: usize>(
1624        &mut self,
1625        node_id: super::node_record::NodeId,
1626        service_name: &str,
1627        service_type: &str,
1628        service_hash: &str,
1629        qos: QoSProfile,
1630        callback: Option<RawResponseCallback>,
1631        context: *mut core::ffi::c_void,
1632    ) -> Result<HandleId, NodeError> {
1633        Executor::register_service_client_raw_sized_on::<REPLY_BUF>(
1634            self,
1635            node_id,
1636            service_name,
1637            service_type,
1638            service_hash,
1639            qos,
1640            callback,
1641            context,
1642        )
1643    }
1644
1645    #[allow(clippy::too_many_arguments)]
1646    #[inline]
1647    fn register_service_raw_sized_on<const REQ_BUF: usize, const REPLY_BUF: usize>(
1648        &mut self,
1649        node_id: super::node_record::NodeId,
1650        service_name: &str,
1651        service_type: &str,
1652        service_hash: &str,
1653        qos: QoSProfile,
1654        callback: RawServiceCallback,
1655        context: *mut core::ffi::c_void,
1656    ) -> Result<HandleId, NodeError> {
1657        Executor::register_service_raw_sized_on::<REQ_BUF, REPLY_BUF>(
1658            self,
1659            node_id,
1660            service_name,
1661            service_type,
1662            service_hash,
1663            qos,
1664            callback,
1665            context,
1666        )
1667    }
1668
1669    #[inline]
1670    unsafe fn service_client_entry_mut(
1671        &mut self,
1672        entry_index: usize,
1673    ) -> Option<&mut super::arena::ServiceClientRawArenaEntry<{ crate::config::DEFAULT_RX_BUF_SIZE }>>
1674    {
1675        unsafe { Executor::service_client_entry_mut(self, entry_index) }
1676    }
1677
1678    #[cfg(feature = "alloc")]
1679    #[inline]
1680    unsafe fn from_session_ptr(session_ptr: *mut session::ConcreteSession) -> Executor<'static> {
1681        unsafe { Executor::<'static>::from_session_ptr(session_ptr) }
1682    }
1683
1684    #[inline]
1685    unsafe fn from_session_in(
1686        session: session::ConcreteSession,
1687        backing: &'s mut [MaybeUninit<u64>],
1688        sizing: super::storage::ExecutorSizing,
1689    ) -> Self {
1690        unsafe { Executor::from_session_in(session, backing, sizing) }
1691    }
1692
1693    #[inline]
1694    unsafe fn open_with_session_in(
1695        session: *mut session::ConcreteSession,
1696        backing: &'s mut [MaybeUninit<u64>],
1697        sizing: super::storage::ExecutorSizing,
1698    ) -> Self {
1699        unsafe { Executor::open_with_session_in(session, backing, sizing) }
1700    }
1701
1702    #[cfg(feature = "alloc")]
1703    #[inline]
1704    unsafe fn open_with_session_slot(
1705        session: *mut session::ConcreteSession,
1706        slot: &'s mut super::SchedTaskExecutorBackingSlot,
1707    ) -> Self {
1708        unsafe { Executor::open_with_session_slot(session, slot) }
1709    }
1710
1711    #[cfg(feature = "alloc")]
1712    #[inline]
1713    unsafe fn open_with_session_handle_slot(
1714        handle: SessionHandle,
1715        slot: &'s mut super::SchedTaskExecutorBackingSlot,
1716    ) -> Self {
1717        unsafe { Executor::open_with_session_handle_slot(handle, slot) }
1718    }
1719
1720    #[inline]
1721    unsafe fn detach_action_client_raw(&mut self, entry_index: usize) -> bool {
1722        unsafe { Executor::detach_action_client_raw(self, entry_index) }
1723    }
1724
1725    #[inline]
1726    unsafe fn detach_action_server_raw(&mut self, handle: &ActionServerRawHandle) -> bool {
1727        unsafe { Executor::detach_action_server_raw(self, handle) }
1728    }
1729
1730    #[inline]
1731    unsafe fn detach_action_server_raw_sized<
1732        const GOAL_BUF: usize,
1733        const RESULT_BUF: usize,
1734        const FEEDBACK_BUF: usize,
1735        const MAX_GOALS: usize,
1736    >(
1737        &mut self,
1738        entry_index: usize,
1739    ) -> bool {
1740        unsafe {
1741            Executor::detach_action_server_raw_sized::<GOAL_BUF, RESULT_BUF, FEEDBACK_BUF, MAX_GOALS>(
1742                self,
1743                entry_index,
1744            )
1745        }
1746    }
1747
1748    #[inline]
1749    unsafe fn release_action_client_raw_sized<
1750        const GOAL_BUF: usize,
1751        const RESULT_BUF: usize,
1752        const FEEDBACK_BUF: usize,
1753    >(
1754        &mut self,
1755        entry_index: usize,
1756    ) -> bool {
1757        unsafe {
1758            Executor::release_action_client_raw_sized::<GOAL_BUF, RESULT_BUF, FEEDBACK_BUF>(
1759                self,
1760                entry_index,
1761            )
1762        }
1763    }
1764
1765    #[inline]
1766    unsafe fn release_action_server_raw_sized<
1767        const GOAL_BUF: usize,
1768        const RESULT_BUF: usize,
1769        const FEEDBACK_BUF: usize,
1770        const MAX_GOALS: usize,
1771    >(
1772        &mut self,
1773        entry_index: usize,
1774    ) -> bool {
1775        unsafe {
1776            Executor::release_action_server_raw_sized::<GOAL_BUF, RESULT_BUF, FEEDBACK_BUF, MAX_GOALS>(
1777                self,
1778                entry_index,
1779            )
1780        }
1781    }
1782
1783    #[inline]
1784    fn register_service_raw(
1785        &mut self,
1786        service_name: &str,
1787        service_type: &str,
1788        service_hash: &str,
1789        callback: RawServiceCallback,
1790        context: *mut core::ffi::c_void,
1791    ) -> Result<HandleId, NodeError> {
1792        Executor::register_service_raw(
1793            self,
1794            service_name,
1795            service_type,
1796            service_hash,
1797            callback,
1798            context,
1799        )
1800    }
1801
1802    #[inline]
1803    fn register_service_client_raw(
1804        &mut self,
1805        service_name: &str,
1806        service_type: &str,
1807        service_hash: &str,
1808        callback: Option<RawResponseCallback>,
1809        context: *mut core::ffi::c_void,
1810    ) -> Result<HandleId, NodeError> {
1811        Executor::register_service_client_raw(
1812            self,
1813            service_name,
1814            service_type,
1815            service_hash,
1816            callback,
1817            context,
1818        )
1819    }
1820
1821    #[doc(hidden)]
1822    #[inline]
1823    fn register_action_client_core<
1824        const GOAL_BUF: usize,
1825        const RESULT_BUF: usize,
1826        const FEEDBACK_BUF: usize,
1827    >(
1828        &mut self,
1829        core: ActionClientCore<GOAL_BUF, RESULT_BUF, FEEDBACK_BUF>,
1830        goal_response_callback: Option<RawGoalResponseCallback>,
1831        feedback_callback: Option<RawFeedbackCallback>,
1832        result_callback: Option<RawResultCallback>,
1833        cancel_response_callback: Option<RawCancelResponseCallback>,
1834        context: *mut core::ffi::c_void,
1835    ) -> Result<ActionClientRawHandle, NodeError> {
1836        Executor::register_action_client_core::<GOAL_BUF, RESULT_BUF, FEEDBACK_BUF>(
1837            self,
1838            core,
1839            goal_response_callback,
1840            feedback_callback,
1841            result_callback,
1842            cancel_response_callback,
1843            context,
1844        )
1845    }
1846
1847    #[inline]
1848    unsafe fn release_guard_condition(&mut self, handle: HandleId) -> bool {
1849        unsafe { Executor::release_guard_condition(self, handle) }
1850    }
1851}
1852
1853// ── phase-515 R9 stage 2: the action cores and raw handles ─────────────
1854
1855impl<
1856    const GOAL_BUF: usize,
1857    const RESULT_BUF: usize,
1858    const FEEDBACK_BUF: usize,
1859    const MAX_GOALS: usize,
1860> sealed::Sealed for ActionServerCore<GOAL_BUF, RESULT_BUF, FEEDBACK_BUF, MAX_GOALS>
1861{
1862}
1863impl<const GOAL_BUF: usize, const RESULT_BUF: usize, const FEEDBACK_BUF: usize> sealed::Sealed
1864    for ActionClientCore<GOAL_BUF, RESULT_BUF, FEEDBACK_BUF>
1865{
1866}
1867impl sealed::Sealed for ActionServerRawHandle {}
1868impl sealed::Sealed for ActionClientRawHandle {}
1869
1870/// [`ActionServerCore`]'s methods, for `nros-c`, `nros-cpp` and the `nros` runtime. Sealed.
1871pub trait ActionServerCoreFfi: sealed::Sealed + Sized {
1872    /// The FFI entry point; see `ActionServerCore::from_channels` in `action_core.rs`.
1873    fn from_channels(
1874        send_goal_server: session::RmwServiceServer,
1875        cancel_goal_server: session::RmwServiceServer,
1876        get_result_server: session::RmwServiceServer,
1877        feedback_publisher: session::RmwPublisher,
1878        status_publisher: session::RmwPublisher,
1879    ) -> Self;
1880
1881    /// The FFI entry point; see `ActionServerCore::try_recv_goal_request` in `action_core.rs`.
1882    fn try_recv_goal_request(&mut self) -> Result<Option<RawGoalRequest>, NodeError>;
1883
1884    /// The FFI entry point; see `ActionServerCore::goal_buffer` in `action_core.rs`.
1885    fn goal_buffer(&self) -> &[u8];
1886
1887    /// The FFI entry point; see `ActionServerCore::accept_goal` in `action_core.rs`.
1888    fn accept_goal(&mut self, goal_id: GoalUuid, seq: i64) -> Result<(), NodeError>;
1889
1890    /// The FFI entry point; see `ActionServerCore::reject_goal` in `action_core.rs`.
1891    fn reject_goal(&mut self, seq: i64) -> Result<(), NodeError>;
1892
1893    /// The FFI entry point; see `ActionServerCore::publish_feedback_raw` in `action_core.rs`.
1894    fn publish_feedback_raw(
1895        &mut self,
1896        goal_id: &GoalUuid,
1897        feedback_cdr: &[u8],
1898    ) -> Result<(), NodeError>;
1899
1900    /// The FFI entry point; see `ActionServerCore::set_goal_status` in `action_core.rs`.
1901    fn set_goal_status(&mut self, goal_id: &GoalUuid, status: GoalStatusCode);
1902
1903    /// The FFI entry point; see `ActionServerCore::expire_completed_results` in `action_core.rs`.
1904    fn expire_completed_results(&mut self) -> usize;
1905
1906    /// The FFI entry point; see `ActionServerCore::completed_result_count` in `action_core.rs`.
1907    fn completed_result_count(&self) -> usize;
1908
1909    /// The FFI entry point; see `ActionServerCore::result_slab_used` in `action_core.rs`.
1910    fn result_slab_used(&self) -> usize;
1911
1912    /// The FFI entry point; see `ActionServerCore::goal_exists` in `action_core.rs`.
1913    fn goal_exists(&self, goal_id: &GoalUuid) -> bool;
1914
1915    /// The FFI entry point; see `ActionServerCore::has_completed_result` in `action_core.rs`.
1916    fn has_completed_result(&self, goal_id: &GoalUuid) -> bool;
1917
1918    /// The FFI entry point; see `ActionServerCore::complete_goal_raw` in `action_core.rs`.
1919    fn complete_goal_raw(
1920        &mut self,
1921        goal_id: &GoalUuid,
1922        status: GoalStatusCode,
1923        result_cdr: &[u8],
1924    ) -> Result<(), NodeError>;
1925
1926    /// The FFI entry point; see `ActionServerCore::register_goal_waker` in `action_core.rs`.
1927    fn register_goal_waker(&self, waker: &core::task::Waker) -> bool;
1928
1929    /// The FFI entry point; see `ActionServerCore::register_cancel_waker` in `action_core.rs`.
1930    fn register_cancel_waker(&self, waker: &core::task::Waker) -> bool;
1931
1932    /// The FFI entry point; see `ActionServerCore::register_get_result_waker` in `action_core.rs`.
1933    fn register_get_result_waker(&self, waker: &core::task::Waker) -> bool;
1934
1935    /// The FFI entry point; see `ActionServerCore::try_recv_cancel_request` in `action_core.rs`.
1936    fn try_recv_cancel_request(&mut self) -> Result<Option<PendingCancelRequest>, NodeError>;
1937
1938    /// The FFI entry point; see `ActionServerCore::send_cancel_reply` in `action_core.rs`.
1939    fn send_cancel_reply(
1940        &mut self,
1941        sequence_number: i64,
1942        return_code: nros_core::CancelResponseCode,
1943        accepted: &[GoalUuid],
1944    ) -> Result<(), NodeError>;
1945
1946    /// The FFI entry point; see `ActionServerCore::try_handle_cancel` in `action_core.rs`.
1947    fn try_handle_cancel(
1948        &mut self,
1949        cancel_handler: impl FnMut(&GoalUuid, GoalStatusCode) -> nros_core::CancelResponse,
1950    ) -> Result<Option<(GoalUuid, nros_core::CancelResponse)>, NodeError>;
1951
1952    /// The FFI entry point; see `ActionServerCore::try_handle_get_result_raw` in `action_core.rs`.
1953    fn try_handle_get_result_raw(
1954        &mut self,
1955        default_result_cdr: &[u8],
1956    ) -> Result<Option<GoalUuid>, NodeError>;
1957
1958    /// The FFI entry point; see `ActionServerCore::active_goal_count` in `action_core.rs`.
1959    fn active_goal_count(&self) -> usize;
1960
1961    /// The FFI entry point; see `ActionServerCore::active_goals` in `action_core.rs`.
1962    fn active_goals(&self) -> &[RawActiveGoal];
1963
1964    /// The FFI entry point; see `ActionServerCore::goal_stamp` in `action_core.rs`.
1965    fn goal_stamp(&self, goal_id: &GoalUuid) -> Time;
1966
1967    /// The FFI entry point; see `ActionServerCore::find_goal_status` in `action_core.rs`.
1968    fn find_goal_status(&self, goal_id: &GoalUuid) -> GoalStatusCode;
1969
1970    /// The FFI entry point; see `ActionServerCore::publish_status_array` in `action_core.rs`.
1971    fn publish_status_array(&self) -> Result<(), NodeError>;
1972}
1973
1974impl<
1975    const GOAL_BUF: usize,
1976    const RESULT_BUF: usize,
1977    const FEEDBACK_BUF: usize,
1978    const MAX_GOALS: usize,
1979> ActionServerCoreFfi for ActionServerCore<GOAL_BUF, RESULT_BUF, FEEDBACK_BUF, MAX_GOALS>
1980{
1981    #[inline]
1982    fn from_channels(
1983        send_goal_server: session::RmwServiceServer,
1984        cancel_goal_server: session::RmwServiceServer,
1985        get_result_server: session::RmwServiceServer,
1986        feedback_publisher: session::RmwPublisher,
1987        status_publisher: session::RmwPublisher,
1988    ) -> Self {
1989        Self::from_channels(
1990            send_goal_server,
1991            cancel_goal_server,
1992            get_result_server,
1993            feedback_publisher,
1994            status_publisher,
1995        )
1996    }
1997
1998    #[inline]
1999    fn try_recv_goal_request(&mut self) -> Result<Option<RawGoalRequest>, NodeError> {
2000        Self::try_recv_goal_request(self)
2001    }
2002
2003    #[inline]
2004    fn goal_buffer(&self) -> &[u8] {
2005        Self::goal_buffer(self)
2006    }
2007
2008    #[inline]
2009    fn accept_goal(&mut self, goal_id: GoalUuid, seq: i64) -> Result<(), NodeError> {
2010        Self::accept_goal(self, goal_id, seq)
2011    }
2012
2013    #[inline]
2014    fn reject_goal(&mut self, seq: i64) -> Result<(), NodeError> {
2015        Self::reject_goal(self, seq)
2016    }
2017
2018    #[inline]
2019    fn publish_feedback_raw(
2020        &mut self,
2021        goal_id: &GoalUuid,
2022        feedback_cdr: &[u8],
2023    ) -> Result<(), NodeError> {
2024        Self::publish_feedback_raw(self, goal_id, feedback_cdr)
2025    }
2026
2027    #[inline]
2028    fn set_goal_status(&mut self, goal_id: &GoalUuid, status: GoalStatusCode) {
2029        Self::set_goal_status(self, goal_id, status)
2030    }
2031
2032    #[inline]
2033    fn expire_completed_results(&mut self) -> usize {
2034        Self::expire_completed_results(self)
2035    }
2036
2037    #[inline]
2038    fn completed_result_count(&self) -> usize {
2039        Self::completed_result_count(self)
2040    }
2041
2042    #[inline]
2043    fn result_slab_used(&self) -> usize {
2044        Self::result_slab_used(self)
2045    }
2046
2047    #[inline]
2048    fn goal_exists(&self, goal_id: &GoalUuid) -> bool {
2049        Self::goal_exists(self, goal_id)
2050    }
2051
2052    #[inline]
2053    fn has_completed_result(&self, goal_id: &GoalUuid) -> bool {
2054        Self::has_completed_result(self, goal_id)
2055    }
2056
2057    #[inline]
2058    fn complete_goal_raw(
2059        &mut self,
2060        goal_id: &GoalUuid,
2061        status: GoalStatusCode,
2062        result_cdr: &[u8],
2063    ) -> Result<(), NodeError> {
2064        Self::complete_goal_raw(self, goal_id, status, result_cdr)
2065    }
2066
2067    #[inline]
2068    fn register_goal_waker(&self, waker: &core::task::Waker) -> bool {
2069        Self::register_goal_waker(self, waker)
2070    }
2071
2072    #[inline]
2073    fn register_cancel_waker(&self, waker: &core::task::Waker) -> bool {
2074        Self::register_cancel_waker(self, waker)
2075    }
2076
2077    #[inline]
2078    fn register_get_result_waker(&self, waker: &core::task::Waker) -> bool {
2079        Self::register_get_result_waker(self, waker)
2080    }
2081
2082    #[inline]
2083    fn try_recv_cancel_request(&mut self) -> Result<Option<PendingCancelRequest>, NodeError> {
2084        Self::try_recv_cancel_request(self)
2085    }
2086
2087    #[inline]
2088    fn send_cancel_reply(
2089        &mut self,
2090        sequence_number: i64,
2091        return_code: nros_core::CancelResponseCode,
2092        accepted: &[GoalUuid],
2093    ) -> Result<(), NodeError> {
2094        Self::send_cancel_reply(self, sequence_number, return_code, accepted)
2095    }
2096
2097    #[inline]
2098    fn try_handle_cancel(
2099        &mut self,
2100        cancel_handler: impl FnMut(&GoalUuid, GoalStatusCode) -> nros_core::CancelResponse,
2101    ) -> Result<Option<(GoalUuid, nros_core::CancelResponse)>, NodeError> {
2102        Self::try_handle_cancel(self, cancel_handler)
2103    }
2104
2105    #[inline]
2106    fn try_handle_get_result_raw(
2107        &mut self,
2108        default_result_cdr: &[u8],
2109    ) -> Result<Option<GoalUuid>, NodeError> {
2110        Self::try_handle_get_result_raw(self, default_result_cdr)
2111    }
2112
2113    #[inline]
2114    fn active_goal_count(&self) -> usize {
2115        Self::active_goal_count(self)
2116    }
2117
2118    #[inline]
2119    fn active_goals(&self) -> &[RawActiveGoal] {
2120        Self::active_goals(self)
2121    }
2122
2123    #[inline]
2124    fn goal_stamp(&self, goal_id: &GoalUuid) -> Time {
2125        Self::goal_stamp(self, goal_id)
2126    }
2127
2128    #[inline]
2129    fn find_goal_status(&self, goal_id: &GoalUuid) -> GoalStatusCode {
2130        Self::find_goal_status(self, goal_id)
2131    }
2132
2133    #[inline]
2134    fn publish_status_array(&self) -> Result<(), NodeError> {
2135        Self::publish_status_array(self)
2136    }
2137}
2138
2139/// [`ActionClientCore`]'s methods, for `nros-c`, `nros-cpp` and the `nros` runtime. Sealed.
2140pub trait ActionClientCoreFfi: sealed::Sealed + Sized {
2141    /// The FFI entry point; see `ActionClientCore::is_server_ready` in `action_core.rs`.
2142    fn is_server_ready(&self) -> bool;
2143
2144    /// The FFI entry point; see `ActionClientCore::server_readiness` in `action_core.rs`.
2145    fn server_readiness(&self) -> Result<bool, nros_rmw::TransportError>;
2146
2147    /// The FFI entry point; see `ActionClientCore::new` in `action_core.rs`.
2148    fn new(
2149        send_goal_client: session::RmwServiceClient,
2150        cancel_goal_client: session::RmwServiceClient,
2151        get_result_client: session::RmwServiceClient,
2152        feedback_subscriber: session::RmwSubscriber,
2153    ) -> Self;
2154
2155    /// The FFI entry point; see `ActionClientCore::send_goal_raw` in `action_core.rs`.
2156    fn send_goal_raw(&mut self, goal_cdr: &[u8]) -> Result<GoalUuid, NodeError>;
2157
2158    /// The FFI entry point; see `ActionClientCore::try_recv_feedback_raw` in `action_core.rs`.
2159    fn try_recv_feedback_raw(&mut self) -> Result<Option<(GoalUuid, usize)>, NodeError>;
2160
2161    /// The FFI entry point; see `ActionClientCore::send_cancel_request` in `action_core.rs`.
2162    fn send_cancel_request(&mut self, goal_id: &GoalUuid) -> Result<(), NodeError>;
2163
2164    /// The FFI entry point; see `ActionClientCore::send_cancel_request_stamped` in `action_core.rs`.
2165    fn send_cancel_request_stamped(
2166        &mut self,
2167        goal_id: &GoalUuid,
2168        stamp_sec: i32,
2169        stamp_nanosec: u32,
2170    ) -> Result<i64, NodeError>;
2171
2172    /// The FFI entry point; see `ActionClientCore::send_get_result_request` in `action_core.rs`.
2173    fn send_get_result_request(&mut self, goal_id: &GoalUuid) -> Result<(), NodeError>;
2174
2175    /// The FFI entry point; see `ActionClientCore::register_goal_response_waker` in `action_core.rs`.
2176    fn register_goal_response_waker(&self, waker: &core::task::Waker) -> bool;
2177
2178    /// The FFI entry point; see `ActionClientCore::register_cancel_response_waker` in `action_core.rs`.
2179    fn register_cancel_response_waker(&self, waker: &core::task::Waker) -> bool;
2180
2181    /// The FFI entry point; see `ActionClientCore::register_result_waker` in `action_core.rs`.
2182    fn register_result_waker(&self, waker: &core::task::Waker) -> bool;
2183
2184    /// The FFI entry point; see `ActionClientCore::register_feedback_waker` in `action_core.rs`.
2185    fn register_feedback_waker(&self, waker: &core::task::Waker) -> bool;
2186
2187    /// The FFI entry point; see `ActionClientCore::try_recv_cancel_reply` in `action_core.rs`.
2188    fn try_recv_cancel_reply(&mut self) -> Result<Option<usize>, NodeError>;
2189
2190    /// The FFI entry point; see `ActionClientCore::try_recv_cancel_reply_for` in `action_core.rs`.
2191    fn try_recv_cancel_reply_for(&mut self) -> Result<Option<(usize, GoalUuid)>, NodeError>;
2192
2193    /// The FFI entry point; see `ActionClientCore::try_recv_cancel_reply_seq` in `action_core.rs`.
2194    fn try_recv_cancel_reply_seq(&mut self) -> Result<Option<(usize, i64, GoalUuid)>, NodeError>;
2195
2196    /// The FFI entry point; see `ActionClientCore::try_recv_get_result_reply` in `action_core.rs`.
2197    fn try_recv_get_result_reply(&mut self) -> Result<Option<usize>, NodeError>;
2198
2199    /// The FFI entry point; see `ActionClientCore::try_recv_get_result_reply_for` in `action_core.rs`.
2200    fn try_recv_get_result_reply_for(&mut self) -> Result<Option<(usize, GoalUuid)>, NodeError>;
2201
2202    /// The FFI entry point; see `ActionClientCore::try_recv_send_goal_reply` in `action_core.rs`.
2203    fn try_recv_send_goal_reply(&mut self) -> Result<Option<usize>, NodeError>;
2204
2205    /// The FFI entry point; see `ActionClientCore::try_recv_send_goal_reply_for` in `action_core.rs`.
2206    fn try_recv_send_goal_reply_for(&mut self) -> Result<Option<(usize, GoalUuid)>, NodeError>;
2207
2208    /// The FFI entry point; see `ActionClientCore::forget_send_goal` in `action_core.rs`.
2209    fn forget_send_goal(&mut self, goal_id: &GoalUuid) -> bool;
2210
2211    /// The FFI entry point; see `ActionClientCore::forget_get_result` in `action_core.rs`.
2212    fn forget_get_result(&mut self, goal_id: &GoalUuid) -> bool;
2213
2214    /// The FFI entry point; see `ActionClientCore::forget_cancel` in `action_core.rs`.
2215    fn forget_cancel(&mut self, goal_id: &GoalUuid) -> bool;
2216
2217    /// The FFI entry point; see `ActionClientCore::result_buffer_ref` in `action_core.rs`.
2218    fn result_buffer_ref(&self) -> &[u8];
2219
2220    /// The FFI entry point; see `ActionClientCore::feedback_buffer_ref` in `action_core.rs`.
2221    fn feedback_buffer_ref(&self) -> &[u8];
2222
2223    /// The FFI entry point; see `ActionClientCore::goal_counter` in `action_core.rs`.
2224    fn goal_counter(&self) -> u64;
2225}
2226
2227impl<const GOAL_BUF: usize, const RESULT_BUF: usize, const FEEDBACK_BUF: usize> ActionClientCoreFfi
2228    for ActionClientCore<GOAL_BUF, RESULT_BUF, FEEDBACK_BUF>
2229{
2230    #[inline]
2231    fn is_server_ready(&self) -> bool {
2232        Self::is_server_ready(self)
2233    }
2234
2235    #[inline]
2236    fn server_readiness(&self) -> Result<bool, nros_rmw::TransportError> {
2237        Self::server_readiness(self)
2238    }
2239
2240    #[inline]
2241    fn new(
2242        send_goal_client: session::RmwServiceClient,
2243        cancel_goal_client: session::RmwServiceClient,
2244        get_result_client: session::RmwServiceClient,
2245        feedback_subscriber: session::RmwSubscriber,
2246    ) -> Self {
2247        Self::new(
2248            send_goal_client,
2249            cancel_goal_client,
2250            get_result_client,
2251            feedback_subscriber,
2252        )
2253    }
2254
2255    #[inline]
2256    fn send_goal_raw(&mut self, goal_cdr: &[u8]) -> Result<GoalUuid, NodeError> {
2257        Self::send_goal_raw(self, goal_cdr)
2258    }
2259
2260    #[inline]
2261    fn try_recv_feedback_raw(&mut self) -> Result<Option<(GoalUuid, usize)>, NodeError> {
2262        Self::try_recv_feedback_raw(self)
2263    }
2264
2265    #[inline]
2266    fn send_cancel_request(&mut self, goal_id: &GoalUuid) -> Result<(), NodeError> {
2267        Self::send_cancel_request(self, goal_id)
2268    }
2269
2270    #[inline]
2271    fn send_cancel_request_stamped(
2272        &mut self,
2273        goal_id: &GoalUuid,
2274        stamp_sec: i32,
2275        stamp_nanosec: u32,
2276    ) -> Result<i64, NodeError> {
2277        Self::send_cancel_request_stamped(self, goal_id, stamp_sec, stamp_nanosec)
2278    }
2279
2280    #[inline]
2281    fn send_get_result_request(&mut self, goal_id: &GoalUuid) -> Result<(), NodeError> {
2282        Self::send_get_result_request(self, goal_id)
2283    }
2284
2285    #[inline]
2286    fn register_goal_response_waker(&self, waker: &core::task::Waker) -> bool {
2287        Self::register_goal_response_waker(self, waker)
2288    }
2289
2290    #[inline]
2291    fn register_cancel_response_waker(&self, waker: &core::task::Waker) -> bool {
2292        Self::register_cancel_response_waker(self, waker)
2293    }
2294
2295    #[inline]
2296    fn register_result_waker(&self, waker: &core::task::Waker) -> bool {
2297        Self::register_result_waker(self, waker)
2298    }
2299
2300    #[inline]
2301    fn register_feedback_waker(&self, waker: &core::task::Waker) -> bool {
2302        Self::register_feedback_waker(self, waker)
2303    }
2304
2305    #[inline]
2306    fn try_recv_cancel_reply(&mut self) -> Result<Option<usize>, NodeError> {
2307        Self::try_recv_cancel_reply(self)
2308    }
2309
2310    #[inline]
2311    fn try_recv_cancel_reply_for(&mut self) -> Result<Option<(usize, GoalUuid)>, NodeError> {
2312        Self::try_recv_cancel_reply_for(self)
2313    }
2314
2315    #[inline]
2316    fn try_recv_cancel_reply_seq(&mut self) -> Result<Option<(usize, i64, GoalUuid)>, NodeError> {
2317        Self::try_recv_cancel_reply_seq(self)
2318    }
2319
2320    #[inline]
2321    fn try_recv_get_result_reply(&mut self) -> Result<Option<usize>, NodeError> {
2322        Self::try_recv_get_result_reply(self)
2323    }
2324
2325    #[inline]
2326    fn try_recv_get_result_reply_for(&mut self) -> Result<Option<(usize, GoalUuid)>, NodeError> {
2327        Self::try_recv_get_result_reply_for(self)
2328    }
2329
2330    #[inline]
2331    fn try_recv_send_goal_reply(&mut self) -> Result<Option<usize>, NodeError> {
2332        Self::try_recv_send_goal_reply(self)
2333    }
2334
2335    #[inline]
2336    fn try_recv_send_goal_reply_for(&mut self) -> Result<Option<(usize, GoalUuid)>, NodeError> {
2337        Self::try_recv_send_goal_reply_for(self)
2338    }
2339
2340    #[inline]
2341    fn forget_send_goal(&mut self, goal_id: &GoalUuid) -> bool {
2342        Self::forget_send_goal(self, goal_id)
2343    }
2344
2345    #[inline]
2346    fn forget_get_result(&mut self, goal_id: &GoalUuid) -> bool {
2347        Self::forget_get_result(self, goal_id)
2348    }
2349
2350    #[inline]
2351    fn forget_cancel(&mut self, goal_id: &GoalUuid) -> bool {
2352        Self::forget_cancel(self, goal_id)
2353    }
2354
2355    #[inline]
2356    fn result_buffer_ref(&self) -> &[u8] {
2357        Self::result_buffer_ref(self)
2358    }
2359
2360    #[inline]
2361    fn feedback_buffer_ref(&self) -> &[u8] {
2362        Self::feedback_buffer_ref(self)
2363    }
2364
2365    #[inline]
2366    fn goal_counter(&self) -> u64 {
2367        Self::goal_counter(self)
2368    }
2369}
2370
2371/// [`ActionServerRawHandle`]'s methods, for `nros-c`, `nros-cpp` and the `nros` runtime. Sealed.
2372pub trait ActionServerRawHandleFfi: sealed::Sealed + Sized {
2373    /// The FFI entry point; see `ActionServerRawHandle::invalid` in `action.rs`
2374    /// (a `const fn` there; a trait method cannot be one).
2375    fn invalid() -> Self;
2376
2377    /// The FFI entry point; see `ActionServerRawHandle::is_invalid` in `action.rs`.
2378    fn is_invalid(&self) -> bool;
2379
2380    /// The FFI entry point; see `ActionServerRawHandle::handle_id` in `action.rs`.
2381    fn handle_id(&self) -> HandleId;
2382
2383    /// The FFI entry point; see `ActionServerRawHandle::publish_feedback_raw` in `action.rs`.
2384    fn publish_feedback_raw(
2385        &self,
2386        executor: &mut Executor,
2387        goal_id: &nros_core::GoalUuid,
2388        feedback_data: &[u8],
2389    ) -> Result<(), NodeError>;
2390
2391    /// The FFI entry point; see `ActionServerRawHandle::complete_goal_raw` in `action.rs`.
2392    fn complete_goal_raw(
2393        &self,
2394        executor: &mut Executor,
2395        goal_id: &nros_core::GoalUuid,
2396        status: nros_core::GoalStatusCode,
2397        result_data: &[u8],
2398    ) -> Result<(), NodeError>;
2399
2400    /// The FFI entry point; see `ActionServerRawHandle::set_goal_status` in `action.rs`.
2401    fn set_goal_status(
2402        &self,
2403        executor: &mut Executor,
2404        goal_id: &nros_core::GoalUuid,
2405        status: nros_core::GoalStatusCode,
2406    );
2407
2408    /// The FFI entry point; see `ActionServerRawHandle::active_goal_count` in `action.rs`.
2409    fn active_goal_count(&self, executor: &Executor) -> usize;
2410
2411    /// The FFI entry point; see `ActionServerRawHandle::goal_exists` in `action.rs`.
2412    fn goal_exists(&self, executor: &Executor, goal_id: &nros_core::GoalUuid) -> bool;
2413
2414    /// The FFI entry point; see `ActionServerRawHandle::expire_goals` in `action.rs`.
2415    fn expire_goals(&self, executor: &mut Executor) -> usize;
2416
2417    /// The FFI entry point; see `ActionServerRawHandle::for_each_active_goal` in `action.rs`.
2418    fn for_each_active_goal(&self, executor: &Executor, f: impl FnMut(&RawActiveGoal));
2419
2420    /// The FFI entry point; see `ActionServerRawHandle::goal_status` in `action.rs`.
2421    fn goal_status(
2422        &self,
2423        executor: &Executor,
2424        goal_id: &nros_core::GoalUuid,
2425    ) -> Option<nros_core::GoalStatusCode>;
2426}
2427
2428impl ActionServerRawHandleFfi for ActionServerRawHandle {
2429    #[inline]
2430    fn invalid() -> Self {
2431        Self::invalid()
2432    }
2433
2434    #[inline]
2435    fn is_invalid(&self) -> bool {
2436        Self::is_invalid(self)
2437    }
2438
2439    #[inline]
2440    fn handle_id(&self) -> HandleId {
2441        Self::handle_id(self)
2442    }
2443
2444    #[inline]
2445    fn publish_feedback_raw(
2446        &self,
2447        executor: &mut Executor,
2448        goal_id: &nros_core::GoalUuid,
2449        feedback_data: &[u8],
2450    ) -> Result<(), NodeError> {
2451        Self::publish_feedback_raw(self, executor, goal_id, feedback_data)
2452    }
2453
2454    #[inline]
2455    fn complete_goal_raw(
2456        &self,
2457        executor: &mut Executor,
2458        goal_id: &nros_core::GoalUuid,
2459        status: nros_core::GoalStatusCode,
2460        result_data: &[u8],
2461    ) -> Result<(), NodeError> {
2462        Self::complete_goal_raw(self, executor, goal_id, status, result_data)
2463    }
2464
2465    #[inline]
2466    fn set_goal_status(
2467        &self,
2468        executor: &mut Executor,
2469        goal_id: &nros_core::GoalUuid,
2470        status: nros_core::GoalStatusCode,
2471    ) {
2472        Self::set_goal_status(self, executor, goal_id, status)
2473    }
2474
2475    #[inline]
2476    fn active_goal_count(&self, executor: &Executor) -> usize {
2477        Self::active_goal_count(self, executor)
2478    }
2479
2480    #[inline]
2481    fn goal_exists(&self, executor: &Executor, goal_id: &nros_core::GoalUuid) -> bool {
2482        Self::goal_exists(self, executor, goal_id)
2483    }
2484
2485    #[inline]
2486    fn expire_goals(&self, executor: &mut Executor) -> usize {
2487        Self::expire_goals(self, executor)
2488    }
2489
2490    #[inline]
2491    fn for_each_active_goal(&self, executor: &Executor, f: impl FnMut(&RawActiveGoal)) {
2492        Self::for_each_active_goal(self, executor, f)
2493    }
2494
2495    #[inline]
2496    fn goal_status(
2497        &self,
2498        executor: &Executor,
2499        goal_id: &nros_core::GoalUuid,
2500    ) -> Option<nros_core::GoalStatusCode> {
2501        Self::goal_status(self, executor, goal_id)
2502    }
2503}
2504
2505/// [`ActionClientRawHandle`]'s methods, for `nros-c`, `nros-cpp` and the `nros` runtime. Sealed.
2506pub trait ActionClientRawHandleFfi: sealed::Sealed + Sized {
2507    /// The FFI entry point; see `ActionClientRawHandle::entry_index` in `action.rs`.
2508    fn entry_index(&self) -> usize;
2509}
2510
2511impl ActionClientRawHandleFfi for ActionClientRawHandle {
2512    #[inline]
2513    fn entry_index(&self) -> usize {
2514        Self::entry_index(self)
2515    }
2516}