Crate lookit[][src]

Expand description

The “Lookit!” crate checks for new devices in a cross-platform asynchronous manner. Returns the RawFd equivalent for the target platform.

  • Linux: inotify on /dev/*
  • Web: JavaScript event listeners
  • Others: TODO

Getting Started

async fn run() {
    let mut lookit = Lookit::with_input().expect("no /dev/ access?");

    loop {
        dbg!((&mut lookit).await);
    }
}

pasts::block_on(run());

Implementation

Input

  • inotify => /dev/input/event*
  • window.addEventListener(“gamepadconnected”, function(e) { });

Audio

  • inotify => /dev/snd/pcm*
  • navigator.mediaDevices.getUserMedia(constraints).then(function(s) { }).catch(function(denied_err) {}) // only one speakers connection ever

MIDI

Camera

  • inotify => /dev/video*
  • navigator.mediaDevices.getUserMedia(constraints).then(function(s) { }).catch(function(denied_err) {})

Structs

Device found by the Lookit struct.

Lookit future. Becomes ready when a new device is created.