Skip to main content

run_pairing

Function run_pairing 

Source
pub async fn run_pairing(
    backend: &dyn HidBackend,
    target: ReceiverSelector,
    commands: UnboundedReceiver<PairingCommand>,
    events: UnboundedSender<PairingEvent>,
) -> Result<(), PairingError>
Expand description

Runs a pairing session against target, streaming PairingEvents to events and consuming PairingCommands from commands. Returns when the flow finishes (paired, failed, cancelled, or timed out).

The caller owns the orchestration: spawn this on a runtime, hold the command sender to forward the user’s device pick / cancel, and read events to drive the UI.