pub struct ButtonClient { /* private fields */ }Expand description
ctx.buttons — front-panel presses.
The on-device input surface for a plugin whose operator has no screen and no ground station. The host owns the bus and the short/long decode, so a plugin never re-implements debounce or the action mapping and cannot drift from what the panel’s own UI thinks a press means.
Read-only and non-exclusive: several consumers watch the same bus, so subscribing observes presses without consuming or remapping them.
Implementations§
Source§impl ButtonClient
impl ButtonClient
Sourcepub async fn subscribe(
&self,
callback: Arc<dyn Fn(ButtonPress) + Send + Sync>,
) -> Result<(), ClientError>
pub async fn subscribe( &self, callback: Arc<dyn Fn(ButtonPress) + Send + Sync>, ) -> Result<(), ClientError>
Receive every front-panel press.
The callback gets the decoded ados_protocol::buttons::ButtonPress.
action is None for an unmapped button — the press is still delivered,
so a plugin can bind one the operator has not assigned.
A board with no front panel never fires the callback. That is the resting state, not an error, so this does not fail on a node without buttons.