Skip to main content

Crate openrgb2

Crate openrgb2 

Source
Expand description

Client library for OpenRGB SDK server.

This client is async and requires a tokio runtime to run.

§Example

use openrgb2::{OpenRgbResult, OpenRgbClient};

#[tokio::main]
async fn main() -> OpenRgbResult<()> {
    // connect to default server at localhost
    let client = OpenRgbClient::connect().await?;
    let controllers = client.get_all_controllers().await?;
    controllers.init().await?;
    Ok(())
}

This crates provides the OpenRgbClient and Controller structs. The client is used to connect to the OpenRGB server and retrieve Controllers, after which RGB control can be done using the Controller.

See examples, and OpenRgbClient for client API.

Macros§

impl_enum_discriminant
Implements traits for C-style enums with discriminants. Following traits are implemented:
log_serde
Macro to log (de)serialisation. Enabled only when debugging.

Structs§

AutoStartSettings
Settings related to when and how OpenRGB automatically starts
AutoloadProfile
A profile that should be automatically loaded
Command
A command to update the LEDs in a controller. Commands must be executed using [Self::execute()]. Use [Controller::cmd()] to create a command.
CommandGroup
Command equivalent for a ControllerGroup, which allow you to update multiple controllers.
Controller
An RGBController, which represents a single RGB device that can be controlled.
ControllerGroup
A group of controllers, this is used to manage multiple controllers at once.
ControllerMode
Mode of a controller.
ControllerModeBuilder
Builder for a controller mode.
DetectorSettings
Detection related settings
FlagSet
HidDeviceData
I2cSmbusInterface
Led
A single LED of a controller
LedData
A single LED.
LogEntry
LogManagerSettings
Settings for the LogManager in OpenRGB
MatrixMapData
Should be followed by a
ModeData
RGB controller mode.
OpenRgbClient
Client for the OpenRGB SDK server that provides methods to interact with OpenRGB.
PluginData
Data for OpenRGB plugins.
ProfileData
Data in Profile JSON
ProfileManagerSettings
Settings for the ProfileManager in OpenRGB
RawDeviceInfoList
Holds a list of “raw” I2C, HID or USB devices
Segment
A segment in a zone, which can contain multiple LEDs.
SegmentData
Data for OpenRGB segments
SerialPortData
ServerSettings
SDK server related settings
SettingsSchema
Settings schema returned by GetSettingsSchema packet
SettingsSchemaEntry
Entry for a setting in a SettingsSchema
UiSettings
User Interface settings for OpenRGB
UsbDeviceData
WindowGeometry
Window Geometry of OpenRGB window
Zone
A zone in a controller, which contains one or more LEDs.

Enums§

ClientFlags
Client flags
ColorMode
RGB controller color mode.
ControllerFlags
RGB Controller flags.
ControllerModeKind
Kinds of modes that exist. Direct is usually the mode you want to use.
DeviceType
RGB controller device type.
Direction
Direction for ModeData.
ModeFlag
RGB controller mode flags.
OpenRgbError
Errors that can occur while communicating with the OpenRGB server or creating commands.
OpenRgbLogLevel
Log levels that OpenRGB uses
ProtocolOption
Option that can be used to represent values not supported by the current protocol version. VER is the minimum supported version. ProtocolOption<5, T> means that from sdk version 5 onwards, this will always be Some(T)
ServerFlags
Server flags
SettingsKey
Keys for settings in OpenRGB.
ZoneFlags
Flags for RGB controller zones
ZoneType
Type of zones available.

Traits§

ControllerIndex
Trait for things that can index into a ControllerGroup.

Type Aliases§

Color
RGB controller color, aliased to rgb crate’s RGB8 type.
HidDeviceList
I2cBusList
OpenRgbResult
Type alias for Result<T, OpenRgbError>
SerialPortList
UsbDeviceList