Update
This commit is contained in:
1201
Cargo.lock
generated
Normal file
1201
Cargo.lock
generated
Normal file
File diff suppressed because it is too large
Load Diff
@@ -6,3 +6,6 @@ edition = "2021"
|
|||||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
|
obws = "0.10.0-beta.4"
|
||||||
|
tokio = { version = "1.21.2", features = ["full"] }
|
||||||
|
anyhow = "1.0"
|
||||||
|
19
src/main.rs
19
src/main.rs
@@ -1,3 +1,18 @@
|
|||||||
fn main() {
|
use anyhow::Result;
|
||||||
println!("Hello, world!");
|
use obws::Client;
|
||||||
|
|
||||||
|
#[tokio::main]
|
||||||
|
async fn main() -> Result<()> {
|
||||||
|
// Connect to the OBS instance through obs-websocket.
|
||||||
|
let client = Client::connect("localhost", 4455, Some("OBS")).await?;
|
||||||
|
|
||||||
|
// Get and print out version information of OBS and obs-websocket.
|
||||||
|
let version = client.general().version().await?;
|
||||||
|
println!("{:#?}", version);
|
||||||
|
|
||||||
|
// Get a list of available scenes and print them out.
|
||||||
|
let scene_list = client.scenes().list().await?;
|
||||||
|
println!("{:#?}", scene_list);
|
||||||
|
|
||||||
|
Ok(())
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user