pub struct USBDevice { /* private fields */ }Expand description
Implementation of the luxafor USB device.
Implementations§
Source§impl USBDevice
impl USBDevice
Sourcepub fn read(&self, buffer: &mut [u8]) -> Result<usize, HidError>
pub fn read(&self, buffer: &mut [u8]) -> Result<usize, HidError>
Blocking read on the device and returns the length of the payload.
Sourcepub fn read_timeout(
&self,
buffer: &mut [u8],
timeout: i32,
) -> Result<usize, HidError>
pub fn read_timeout( &self, buffer: &mut [u8], timeout: i32, ) -> Result<usize, HidError>
Same as read but blocking is termianted after the timeout.
Checks whether the mute button is pressed for a period of time.
TODO: Implement feeback using other light modes. Checks whether the mute button is pressed for a period of time and set strobing light as feedback after the timeout.
Sourcepub fn set_static_color(&self, color: Color) -> Result<(), HidError>
pub fn set_static_color(&self, color: Color) -> Result<(), HidError>
Sets a static luxafor light.
Sourcepub fn set_circling_color(
&self,
color: Color,
pattern: CircularLength,
circling_rate: u8,
iterations: u8,
) -> Result<(), HidError>
pub fn set_circling_color( &self, color: Color, pattern: CircularLength, circling_rate: u8, iterations: u8, ) -> Result<(), HidError>
Sets the the luxafor light to a circling color mode.
Auto Trait Implementations§
impl Freeze for USBDevice
impl RefUnwindSafe for USBDevice
impl Send for USBDevice
impl !Sync for USBDevice
impl Unpin for USBDevice
impl UnwindSafe for USBDevice
Blanket Implementations§
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
Mutably borrows from an owned value. Read more