Files
empidee/examples/mpd-client/main.rs
T
oysteikt 644020ea7f
Build and test / build (push) Successful in 1m12s
Build and test / docs (push) Successful in 1m20s
Build and test / check (push) Successful in 1m32s
Build and test / test (push) Successful in 1m47s
flake.lock: bump, Cargo.{toml,lock}: update inputs, fmt, lint
2026-02-07 02:25:34 +09:00

17 lines
445 B
Rust

use empidee::MpdClient;
#[tokio::main(flavor = "current_thread")]
async fn main() -> anyhow::Result<()> {
let socket = tokio::net::TcpSocket::new_v4()?;
let mut stream = socket.connect("127.0.0.1:6600".parse()?).await?;
let mut client = MpdClient::new(&mut stream).await?;
println!(
"Connected to MPD server: {}",
client.get_mpd_version().unwrap_or("unknown")
);
client.play(None).await?;
Ok(())
}