pub trait ClientDispatch {
// Required methods
fn call_raw(
&mut self,
service_entity: &str,
request_cdr: &[u8],
response_buf: &mut [u8],
) -> NodeResult<usize>;
fn send_goal_raw(
&mut self,
action_entity: &str,
goal_cdr: &[u8],
) -> NodeResult<GoalId>;
}Expand description
Executor-backed CLIENT operations a TickCtx drives (Phase 212.M-F.4).
Service-client call + action-client send_goal need &mut Executor
(the W.5.6 client handles live on the executor), which a mid-spin
callback can’t hold. They run from ExecutableNode::tick, between
spins. The generated runtime impls this over the real executor + the
service/action client handles (resolved by stable client entity id); the
component never sees the executor directly. Kept as a trait so TickCtx
stays no_std + free of the rmw-cffi-gated Executor type.
Mirrors the sibling ActionExecutor (server-side ops). Splitting
client vs server keeps each trait small + lets the codegen-side
GenClientDispatch impl resolve client handles independently from
server handles.
Required Methods§
Sourcefn call_raw(
&mut self,
service_entity: &str,
request_cdr: &[u8],
response_buf: &mut [u8],
) -> NodeResult<usize>
fn call_raw( &mut self, service_entity: &str, request_cdr: &[u8], response_buf: &mut [u8], ) -> NodeResult<usize>
Issue a service-client request on service_entity carrying CDR
request_cdr; block on the reply, write the response CDR into
response_buf, return the response length in bytes.
The synchronous block model matches the existing
ServiceClientTrait::call_raw surface in nros-node — the tick
hook drives the executor between callback dispatch, so a blocked
call_raw does not starve other callbacks (each tick yields back
to the runtime after returning).
Sourcefn send_goal_raw(
&mut self,
action_entity: &str,
goal_cdr: &[u8],
) -> NodeResult<GoalId>
fn send_goal_raw( &mut self, action_entity: &str, goal_cdr: &[u8], ) -> NodeResult<GoalId>
Send an action-client goal request on action_entity carrying
CDR goal_cdr; return the assigned GoalId (server-stamped on
the goal-accept response). Result + feedback streams arrive via
callback dispatch — not this method.