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

Method connect

src/lib.rs:125–133  ·  view source on GitHub ↗

Attempts to connect to the device

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

Source from the content-addressed store, hash-verified

123impl StreamDeck {
124 /// Attempts to connect to the device
125 pub fn connect(hidapi: &HidApi, kind: Kind, serial: &str) -> Result<StreamDeck, StreamDeckError> {
126 let device = hidapi.open_serial(kind.vendor_id(), kind.product_id(), serial)?;
127
128 Ok(StreamDeck {
129 kind,
130 device,
131 image_cache: RwLock::new(vec![]),
132 })
133 }
134}
135
136/// Instance methods of the struct

Callers

nothing calls this directly

Calls 2

vendor_idMethod · 0.80
product_idMethod · 0.80

Tested by

no test coverage detected