Function enumerate

Source
pub fn enumerate() -> Result<impl Iterator<Item = Result<Evdev>>>
Expand description

Enumerates all evdev devices, including hotplugged ones.

This will first yield all devices currently plugged in, and then starts yielding hotplug events similar to HotplugMonitor.

This allows an application to process a single stream of Evdevs to both open an already plugged-in device on startup, but also to react to hot-plugged devices automatically, which is typically the desired UX of applications.

Like crate::enumerate, this function returns a blocking iterator that might take a significant amount of time to open each device. This iterator will also keep blocking as it waits for hotplug events, but might terminate if hotplug events are unavailable.

If hotplug support is unimplemented on the current platform, this will degrade gracefully and only yield the currently plugged-in devices.