Attempts to connect to the device
(hidapi: &HidApi, kind: Kind, serial: &str)
| 123 | impl 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 |
nothing calls this directly
no test coverage detected