pub struct StreamDeck { /* private fields */ }
Expand description

Interface for a Stream Deck device

Implementations§

source§

impl StreamDeck

Static functions of the struct

source

pub fn connect( hidapi: &HidApi, kind: Kind, serial: &str ) -> Result<StreamDeck, StreamDeckError>

Attempts to connect to the device

source§

impl StreamDeck

Instance methods of the struct

source

pub fn kind(&self) -> Kind

Returns kind of the Stream Deck

source

pub fn manufacturer(&self) -> Result<String, StreamDeckError>

Returns manufacturer string of the device

source

pub fn product(&self) -> Result<String, StreamDeckError>

Returns product string of the device

source

pub fn serial_number(&self) -> Result<String, StreamDeckError>

Returns serial number of the device

source

pub fn firmware_version(&self) -> Result<String, StreamDeckError>

Returns firmware version of the StreamDeck

source

pub fn read_input( &self, timeout: Option<Duration> ) -> Result<StreamDeckInput, StreamDeckError>

Reads all possible input from Stream Deck device

source

pub fn reset(&self) -> Result<(), StreamDeckError>

Resets the device

source

pub fn set_brightness(&self, percent: u8) -> Result<(), StreamDeckError>

Sets brightness of the device, value range is 0 - 100

source

pub fn write_image( &self, key: u8, image_data: &[u8] ) -> Result<(), StreamDeckError>

Writes image data to Stream Deck device

source

pub fn write_lcd( &self, x: u16, y: u16, rect: &ImageRect ) -> Result<(), StreamDeckError>

Writes image data to Stream Deck device’s lcd strip/screen

source

pub fn clear_button_image(&self, key: u8) -> Result<(), StreamDeckError>

Sets button’s image to blank

source

pub fn set_button_image( &self, key: u8, image: DynamicImage ) -> Result<(), StreamDeckError>

Sets specified button’s image

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

const: unstable · source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> Pointable for T

§

const ALIGN: usize = mem::align_of::<T>()

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
const: unstable · source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.