Struct streamdeck::StreamDeck
source · pub struct StreamDeck { /* private fields */ }
Expand description
StreamDeck object
Implementations§
source§impl StreamDeck
impl StreamDeck
sourcepub fn connect(
vid: u16,
pid: u16,
serial: Option<String>
) -> Result<StreamDeck, Error>
pub fn connect( vid: u16, pid: u16, serial: Option<String> ) -> Result<StreamDeck, Error>
Connect to a streamdeck device
sourcepub fn connect_with_hid(
api: &HidApi,
vid: u16,
pid: u16,
serial: Option<String>
) -> Result<StreamDeck, Error>
pub fn connect_with_hid( api: &HidApi, vid: u16, pid: u16, serial: Option<String> ) -> Result<StreamDeck, Error>
Connect to a streamdeck device with an already initialise HidApi instance
sourcepub fn kind(&self) -> Kind
pub fn kind(&self) -> Kind
Fetch the connected device kind
This can be used to retrieve related device information such as images sizes and modes
sourcepub fn manufacturer(&mut self) -> Result<String, Error>
pub fn manufacturer(&mut self) -> Result<String, Error>
Fetch the device manufacturer string
sourcepub fn set_brightness(&mut self, brightness: u8) -> Result<(), Error>
pub fn set_brightness(&mut self, brightness: u8) -> Result<(), Error>
Set the device display brightness (in percent)
sourcepub fn set_blocking(&mut self, blocking: bool) -> Result<(), Error>
pub fn set_blocking(&mut self, blocking: bool) -> Result<(), Error>
Set blocking mode
See: read_buttons
for discussion of this functionality
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
sourcepub fn image_size(&self) -> (usize, usize)
pub fn image_size(&self) -> (usize, usize)
Fetch image size for the connected device
Set a button to the provided RGB colour
Set a button to the provided image
Sets a button to the provided text. Will break text over \n linebreaks
Set a button to the provided image file
sourcepub fn load_image(
&self,
image: &str,
opts: &ImageOptions
) -> Result<DeviceImage, Error>
pub fn load_image( &self, image: &str, opts: &ImageOptions ) -> Result<DeviceImage, Error>
Load an image file into the device specific representation
Writes an image to a button Image at this point in correct dimensions and in device native colour order.
Auto Trait Implementations§
impl Freeze for StreamDeck
impl !RefUnwindSafe for StreamDeck
impl Send for StreamDeck
impl !Sync for StreamDeck
impl Unpin for StreamDeck
impl !UnwindSafe for StreamDeck
Blanket Implementations§
source§impl<Src, Scheme> ApproxFrom<Src, Scheme> for Srcwhere
Scheme: ApproxScheme,
impl<Src, Scheme> ApproxFrom<Src, Scheme> for Srcwhere
Scheme: ApproxScheme,
source§fn approx_from(src: Src) -> Result<Src, <Src as ApproxFrom<Src, Scheme>>::Err>
fn approx_from(src: Src) -> Result<Src, <Src as ApproxFrom<Src, Scheme>>::Err>
source§impl<Dst, Src, Scheme> ApproxInto<Dst, Scheme> for Srcwhere
Dst: ApproxFrom<Src, Scheme>,
Scheme: ApproxScheme,
impl<Dst, Src, Scheme> ApproxInto<Dst, Scheme> for Srcwhere
Dst: ApproxFrom<Src, Scheme>,
Scheme: ApproxScheme,
§type Err = <Dst as ApproxFrom<Src, Scheme>>::Err
type Err = <Dst as ApproxFrom<Src, Scheme>>::Err
source§fn approx_into(self) -> Result<Dst, <Src as ApproxInto<Dst, Scheme>>::Err>
fn approx_into(self) -> Result<Dst, <Src as ApproxInto<Dst, Scheme>>::Err>
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T, Dst> ConvAsUtil<Dst> for T
impl<T, Dst> ConvAsUtil<Dst> for T
source§impl<T> ConvUtil for T
impl<T> ConvUtil for T
source§fn approx_as<Dst>(self) -> Result<Dst, Self::Err>where
Self: Sized + ApproxInto<Dst>,
fn approx_as<Dst>(self) -> Result<Dst, Self::Err>where
Self: Sized + ApproxInto<Dst>,
source§fn approx_as_by<Dst, Scheme>(self) -> Result<Dst, Self::Err>
fn approx_as_by<Dst, Scheme>(self) -> Result<Dst, Self::Err>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§impl<T> Pointable for T
impl<T> Pointable for T
source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self
from the equivalent element of its
superset. Read moresource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self
is actually part of its subset T
(and can be converted to it).source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset
but without any property checks. Always succeeds.source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self
to the equivalent element of its superset.