Struct roccat_vulcan_api_rs::ColorBuffer [−][src]
pub struct ColorBuffer<T> { /* fields omitted */ }
Expand description
Encode the set of color for crate::KeyboardApi::render
.
Example
use std::{thread::sleep, time::Duration}; use roccat_vulcan_api_rs::{ColorBuffer, ColorRgb, ErrorRoccatVulcanApi, KeyboardApi}; let keyboard = KeyboardApi::new()?; let buffer = ColorBuffer::from_element(ColorRgb::new(255, 0, 255)); keyboard.render(&buffer)?; sleep(Duration::from_secs(1));
Implementations
Create a buffer from an array
Get a mutable reference to the buffer as an array
pub fn iter(
&self
) -> impl Iterator<Item = &T> + FusedIterator + ExactSizeIterator + DoubleEndedIterator
[src]
pub fn iter(
&self
) -> impl Iterator<Item = &T> + FusedIterator + ExactSizeIterator + DoubleEndedIterator
[src]Returns an iterator in the colors
pub fn iter_mut(
&mut self
) -> impl Iterator<Item = &mut T> + FusedIterator + ExactSizeIterator + DoubleEndedIterator
[src]
pub fn iter_mut(
&mut self
) -> impl Iterator<Item = &mut T> + FusedIterator + ExactSizeIterator + DoubleEndedIterator
[src]Return an mutable iterator on the colors
Get an array of u8 that is ready to be send to the led device
Create the buffer with the same color for each key
Trait Implementations
Performs the conversion.
Panic
panics in the case where index
>= NUMBER_KEY_LED_BUFFER
use roccat_vulcan_api_rs::{ColorBuffer, ColorRgb, NUMBER_KEY_LED_BUFFER}; let color_buffer = ColorBuffer::from_element(ColorRgb::new(255, 0, 0)); let _ = color_buffer[NUMBER_KEY_LED_BUFFER];
Panic
panics in the case where index
>= NUMBER_KEY_LED_BUFFER
use roccat_vulcan_api_rs::{ColorBuffer, ColorRgb, NUMBER_KEY_LED_BUFFER}; let mut color_buffer = ColorBuffer::from_element(ColorRgb::new(255, 0, 0)); color_buffer[NUMBER_KEY_LED_BUFFER] = ColorRgb::new(255, 255, 255);
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
This method tests for !=
.
This method returns an ordering between self
and other
values if one exists. Read more
This method tests less than (for self
and other
) and is used by the <
operator. Read more
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
Auto Trait Implementations
impl<T> RefUnwindSafe for ColorBuffer<T> where
T: RefUnwindSafe,
impl<T> Send for ColorBuffer<T> where
T: Send,
impl<T> Sync for ColorBuffer<T> where
T: Sync,
impl<T> Unpin for ColorBuffer<T> where
T: Unpin,
impl<T> UnwindSafe for ColorBuffer<T> where
T: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more