[][src]Struct streamdeck::StreamDeck

pub struct StreamDeck { /* fields omitted */ }

StreamDeck object

Methods

impl StreamDeck[src]

pub fn connect(
    vid: u16,
    pid: u16,
    serial: Option<String>
) -> Result<StreamDeck, Error>
[src]

Connect to a streamdeck device

pub fn kind(&self) -> Kind[src]

Fetch the connected device kind

This can be used to retrieve related device information such as images sizes and modes

pub fn manufacturer(&mut self) -> Result<String, Error>[src]

Fetch the device manufacturer string

pub fn product(&mut self) -> Result<String, Error>[src]

Fetch the device product string

pub fn serial(&mut self) -> Result<String, Error>[src]

Fetch the device serial

pub fn version(&mut self) -> Result<String, Error>[src]

Fetch the device firmware version

pub fn reset(&mut self) -> Result<(), Error>[src]

Reset the connected device

pub fn set_brightness(&mut self, brightness: u8) -> Result<(), Error>[src]

Set the device display brightness (in percent)

pub fn set_blocking(&mut self, blocking: bool) -> Result<(), Error>[src]

Set blocking mode

See: read_buttons for discussion of this functionality

pub fn read_buttons(
    &mut self,
    timeout: Option<Duration>
) -> Result<Vec<u8>, Error>
[src]

Fetch button states

In blocking mode this will wait until a report packet has been received (or the specified timeout has elapsed). In non-blocking mode this will return immediately with a zero vector if no data is available

pub fn image_size(&self) -> (usize, usize)[src]

Fetch image size for the connected device

pub fn set_button_rgb(&mut self, key: u8, colour: &Colour) -> Result<(), Error>[src]

Set a button to the provided RGB colour

pub fn set_button_image(&mut self, key: u8, image: &[u8]) -> Result<(), Error>[src]

Set a button to the provided image

Images in BGR format, IMAGE_X by IMAGE_Y at 3 bytes per pixel

pub fn set_button_file(
    &mut self,
    key: u8,
    image: &str,
    opts: &ImageOptions
) -> Result<(), Error>
[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> SetParameter for T

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.