Crate obws[][src]

Expand description

OBWS - The obws (obvious) remote control library for OBS

Remote control OBS with the obs-websocket plugin from Rust 🦀.

Example

use anyhow::Result;
use obws::Client;

#[tokio::main]
async fn main() -> Result<()> {
    /// Connect to the OBS instance through obs-websocket.
    let client = Client::connect("localhost", 4444).await?;

    /// Get and print out version information of OBS and obs-websocket.
    let version = client.general().get_version().await?;
    println!("{:#?}", version);

    /// Optionally log-in (if enabled in obs-websocket) to allow other APIs and receive events.
    client.login(Some("password")).await?;

    /// Get a list of available scenes and print them out.
    let scene_list = client.scenes().get_scene_list().await?;
    println!("{:#?}", scene_list);

    Ok(())
}

Re-exports

pub use self::client::Client;

Modules

The client to the obs-websocket API and main entry point.

Common data structures shared between requests, responses and events.

All events that can be received from the API.

All requests that can be send to the API.

All responses that can be received from the API.

Structs

A pair of comparison operator and partial version, such as >=1.2. Forms one piece of a VersionReq.

SemVer version as defined by https://semver.org.

Enums

Errors that can occur while using this crate.

Type Definitions

Result type used throughout the crate that uses Error as default error.