MCPcopy Create free account
hub / github.com/OpenActionAPI/rust-elgato-streamdeck / flush

Method flush

src/lib.rs:460–472  ·  view source on GitHub ↗

Flushes the button's image to the device

(&self)

Source from the content-addressed store, hash-verified

458
459 /// Flushes the button's image to the device
460 pub fn flush(&self) -> Result<(), StreamDeckError> {
461 if self.image_cache.read()?.is_empty() {
462 return Ok(());
463 }
464
465 for image in self.image_cache.read()?.iter() {
466 self.send_image(image.key, &image.image_data)?;
467 }
468
469 self.image_cache.write()?.clear();
470
471 Ok(())
472 }
473
474 /// Returns button state reader for this device
475 pub fn get_reader(self: &Arc<Self>) -> Arc<DeviceStateReader> {

Callers 2

mainFunction · 0.45
mainFunction · 0.45

Calls 3

is_emptyMethod · 0.80
send_imageMethod · 0.80
readMethod · 0.45

Tested by

no test coverage detected