Files
empidee/examples/mpd-client/main.rs
h7x4 d964e7857b
Some checks failed
Build and test / docs (push) Has been cancelled
Build and test / test (push) Has been cancelled
Build and test / build (push) Has been cancelled
Build and test / check (push) Has been cancelled
examples/mpd-client: add some code
2025-12-08 13:00:46 +09:00

15 lines
387 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);
println!("{}", client.read_initial_mpd_version().await?);
client.play(None).await?;
Ok(())
}