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 Controller
s,
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. - Command
Group Command
equivalent for aControllerGroup
, which allow you to update multiple controllers.- Controller
- An
RGBController
, which represents a single RGB device that can be controlled. - Controller
Group - A group of controllers, this is used to manage multiple controllers at once.
- Controller
Mode - Mode of a controller.
- Controller
Mode Builder - Builder for a controller mode.
- FlagSet
- Led
- A single LED of a controller
- LedData
- A single LED.
- Mode
Data - RGB controller mode.
- Open
RgbClient - Client for the
OpenRGB
SDK server that provides methods to interact withOpenRGB
. - Plugin
Data - Data for
OpenRGB
plugins. - Segment
- A segment in a zone, which can contain multiple LEDs.
- Segment
Data - Data for
OpenRGB
segments - Zone
- A zone in a controller, which contains one or more LEDs.
Enums§
- Color
Mode - RGB controller color mode.
- Controller
Flags - RGB Controller flags.
- Controller
Mode Kind - Kinds of modes that exist.
Direct
is usually the mode you want to use. - Device
Type - RGB controller device type.
- Direction
- Direction for
ModeData
. - Mode
Flag - RGB controller mode flags.
- Open
RgbError - Errors that can occur while communicating with the
OpenRGB
server or creating commands. - Protocol
Option - Option that can be used to represent values not supported by the current protocol version.
- Zone
Flags - Flags for RGB controller zones
- Zone
Type - Type of zones available.
Traits§
- Controller
Index - Trait for things that can index into a
ControllerGroup
.
Type Aliases§
- Color
- RGB controller color, aliased to rgb crate’s RGB8 type.
- Open
RgbResult - Type alias for
Result<T, OpenRgbError>