pub type OnSetParameterFn = fn(NodeKey, &str, Option<&ParameterValue>, Option<&ParameterValue>, OnSetContext) -> bool;Expand description
An on-set-parameters callback — phase-417 W4.a.
false REFUSES the write, which is rclcpp’s
add_on_set_parameters_callback contract (a SetParametersResult whose
successful is false) and the contract C’s legacy
C’s rclc parameter server carries too (phase-491, with the old value).
A fn pointer plus an OnSetContext, not a closure: this crate is
no_std with no allocator, so there is nothing to box a FnMut into.
phase-491 W2 (RFC-0105 D6) — the hook sees BOTH sides of the change,
rclc’s rclc_parameter_callback_t contract: old is None when the write
would CREATE the parameter (an undeclared remote set), new is None when
it would DELETE it (a remote NOT_SET on a node that asked for
set_delete_on_not_set).
rclcpp’s add_on_set_parameters_callback reads only new, so the C++ and
Rust facades ignore old.