pub struct Enumerator { /* private fields */ }Expand description
Stateful device enumerator: holds the per-device probe cache so the polling
watcher reuses immutable data across ticks instead of re-handshaking every
device every ~2s. One-shot callers use the enumerate free function, which
runs against a fresh (empty) cache.
Implementations§
Source§impl Enumerator
impl Enumerator
Sourcepub async fn enumerate(
&mut self,
) -> Result<Vec<DeviceInventory>, InventoryError>
pub async fn enumerate( &mut self, ) -> Result<Vec<DeviceInventory>, InventoryError>
One enumeration pass, reusing the cache from prior passes. Probes every
HID candidate concurrently (so one asleep node that burns the whole
PROBE_BUDGET can’t stall the others), reusing each device’s cached
immutable data when it’s present and fresh.
A node the OS still lists but whose probe fails (receiver registers unanswered, probe timeout, open failure) is not reported as absent: its last completed inventory is replayed for a bounded grace and its channel is reopened, so a transient HID++ glitch can’t masquerade as “no devices” (#218) — see the node ledger.