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:

Structs§

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.
Led
A single LED.
ModeData
RGB controller mode.
OpenRgbClient
Client for the OpenRGB SDK server that provides methods to interact with OpenRGB.
PluginData
Data for OpenRGB plugins.
Segment
A segment in a zone, which can contain multiple LEDs.
SegmentData
Data for OpenRGB segments
Zone
A zone in a controller, which contains one or more LEDs.

Enums§

ColorMode
RGB controller color mode.
ControllerFlags
RGB Controller flags.
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.
ProtocolOption
Option that can be used to represent values not supported by the current protocol version.
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.
OpenRgbResult
Type alias for Result<T, OpenRgbError>