cue-sdk
A safe, high-level Rust wrapper for the iCUE SDK v4.
For low-level (unsafe) FFI bindings, see the companion crate cue-sdk-sys.
Prerequisites
You need the iCUE SDK native libraries. Download them from the iCUE SDK releases page and set the environment variables required by cue-sdk-sys.
The SDK DLLs/dylibs must be available at runtime (e.g. in your executable's
directory or on your system PATH/LD_LIBRARY_PATH). If they are missing
you will get STATUS_DLL_NOT_FOUND on Windows.
iCUE must be running on the target machine for the SDK to connect.
Quick Start
use Duration;
use DeviceType;
use LedColor;
let session = connect.expect;
session.wait_for_connection.expect;
let devices = session.get_devices.expect;
for dev in &devices
Setting LED Colors
use Duration;
use DeviceType;
use LedColor;
let session = connect.expect;
session.wait_for_connection.expect;
let devices = session.get_devices.expect;
let device = devices.first.expect;
let positions = session.get_led_positions.expect;
let colors: = positions
.iter
.map
.collect;
session.set_led_colors.expect;
Listening for Events
use Duration;
use Event;
let session = connect.expect;
session.wait_for_connection.expect;
let subscription = session.subscribe_for_events.expect;
for event in subscription.iter
Async Event Listening
Enable the async feature to get AsyncEventSubscription and
flush_led_colors_async():
[]
= { = "0.1", = ["async"] }
use Duration;
use Event;
async
Features
| Feature | Description |
|---|---|
async |
Adds AsyncEventSubscription and flush_led_colors_async() via optional tokio dependency |
Examples
Run the included examples with:
Architecture
Sessionis the single entry point for all SDK operations. Callcue_sdk::connect()to create one; it callsCorsairDisconnecton drop.- Devices are identified by
DeviceId(a 128-byte string), not indices. LedColoris#[repr(C)]and layout-identical to the nativeCorsairLedColorstruct for zero-copy FFI.EventSubscriptionauto-unsubscribes on drop.- All
unsafeblocks have// SAFETYcomments.