Skip to main content

OnSetParameterFn

Type Alias OnSetParameterFn 

Source
pub type OnSetParameterFn = fn(node: NodeKey, name: &str, old: Option<&ParameterValue>, new: Option<&ParameterValue>, ctx: 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.