Struct streamdeck::StreamDeck
source · [−]pub struct StreamDeck { /* private fields */ }
Expand description
StreamDeck object
Implementations
sourceimpl 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 RefUnwindSafe for StreamDeck
impl Send for StreamDeck
impl !Sync for StreamDeck
impl Unpin for StreamDeck
impl UnwindSafe for StreamDeck
Blanket Implementations
impl<Src, Scheme> ApproxFrom<Src, Scheme> for Src where
Scheme: ApproxScheme,
impl<Src, Scheme> ApproxFrom<Src, Scheme> for Src where
Scheme: ApproxScheme,
type Err = NoError
type Err = NoError
The error type produced by a failed conversion.
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>
Convert the given value into an approximately equivalent representation.
impl<Dst, Src, Scheme> ApproxInto<Dst, Scheme> for Src where
Dst: ApproxFrom<Src, Scheme>,
Scheme: ApproxScheme,
impl<Dst, Src, Scheme> ApproxInto<Dst, Scheme> for Src where
Dst: ApproxFrom<Src, Scheme>,
Scheme: ApproxScheme,
type Err = <Dst as ApproxFrom<Src, Scheme>>::Err
type Err = <Dst as ApproxFrom<Src, Scheme>>::Err
The error type produced by a failed conversion.
fn approx_into(self) -> Result<Dst, <Src as ApproxInto<Dst, Scheme>>::Err>
fn approx_into(self) -> Result<Dst, <Src as ApproxInto<Dst, Scheme>>::Err>
Convert the subject into an approximately equivalent representation.
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<T> ConvUtil for T
impl<T> ConvUtil for T
fn approx_as<Dst>(self) -> Result<Dst, Self::Err> where
Self: ApproxInto<Dst, DefaultApprox>,
fn approx_as<Dst>(self) -> Result<Dst, Self::Err> where
Self: ApproxInto<Dst, DefaultApprox>,
Approximate the subject to a given type with the default scheme.
fn approx_as_by<Dst, Scheme>(self) -> Result<Dst, Self::Err> where
Self: ApproxInto<Dst, Scheme>,
Scheme: ApproxScheme,
fn approx_as_by<Dst, Scheme>(self) -> Result<Dst, Self::Err> where
Self: ApproxInto<Dst, Scheme>,
Scheme: ApproxScheme,
Approximate the subject to a given type with a specific scheme.
impl<T> Pointable for T
impl<T> Pointable for T
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct self
from the equivalent element of its
superset. Read more
fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if self
is actually part of its subset T
(and can be converted to it).
fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as self.to_subset
but without any property checks. Always succeeds.
fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts self
to the equivalent element of its superset.
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
fn vzip(self) -> V
impl<Src> ValueFrom<Src> for Src
impl<Src> ValueFrom<Src> for Src
type Err = NoError
type Err = NoError
The error type produced by a failed conversion.
fn value_from(src: Src) -> Result<Src, <Src as ValueFrom<Src>>::Err>
fn value_from(src: Src) -> Result<Src, <Src as ValueFrom<Src>>::Err>
Convert the given value into an exactly equivalent representation.
impl<Src, Dst> ValueInto<Dst> for Src where
Dst: ValueFrom<Src>,
impl<Src, Dst> ValueInto<Dst> for Src where
Dst: ValueFrom<Src>,
type Err = <Dst as ValueFrom<Src>>::Err
type Err = <Dst as ValueFrom<Src>>::Err
The error type produced by a failed conversion.
fn value_into(self) -> Result<Dst, <Src as ValueInto<Dst>>::Err>
fn value_into(self) -> Result<Dst, <Src as ValueInto<Dst>>::Err>
Convert the subject into an exactly equivalent representation.