pub struct AsyncStreamDeck { /* private fields */ }
Available on crate feature async only.
Expand description

Stream Deck interface suitable to be used in async

Implementations§

source§

impl AsyncStreamDeck

Static functions of the struct

source

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

Attempts to connect to the device

source§

impl AsyncStreamDeck

Instance methods of the struct

source

pub fn kind(&self) -> Kind

Returns kind of the Stream Deck

source

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

Returns manufacturer string of the device

source

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

Returns product string of the device

source

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

Returns serial number of the device

source

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

Returns firmware version of the StreamDeck

source

pub async fn read_button_states( &self, poll_rate: f32 ) -> Result<Vec<bool>, StreamDeckError>

Reads button states, awaits until there’s data. Poll rate determines how often button state gets checked

source

pub fn get_reader(self: &Arc<Self>) -> Arc<ButtonStateReader>

Returns button state reader for this device

source

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

Resets the device

source

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

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

source

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

Writes image data to Stream Deck device

source

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

Writes image data to Stream Deck device

source

pub async 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.