MCPcopy Create free account
hub / github.com/OpenActionAPI/rust-elgato-streamdeck / connect

Method connect

src/asynchronous.rs:41–48  ·  view source on GitHub ↗

Attempts to connect to the device, can be safely ran inside [multi_thread](tokio::runtime::Builder::new_multi_thread) runtime

(hidapi: &HidApi, kind: Kind, serial: &str)

Source from the content-addressed store, hash-verified

39impl AsyncStreamDeck {
40 /// Attempts to connect to the device, can be safely ran inside [multi_thread](tokio::runtime::Builder::new_multi_thread) runtime
41 pub fn connect(hidapi: &HidApi, kind: Kind, serial: &str) -> Result<AsyncStreamDeck, StreamDeckError> {
42 let device = block_in_place(move || StreamDeck::connect(hidapi, kind, serial))?;
43
44 Ok(AsyncStreamDeck {
45 kind,
46 device: Arc::new(Mutex::new(device)),
47 })
48 }
49}
50
51impl From<StreamDeck> for AsyncStreamDeck {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected