825 B
825 B
headroom-client
Blocking Rust client for the Headroom control protocol.
use headroom_client::{Client, Route};
use headroom_ipc::Topic;
let mut client = Client::connect()?;
println!("connected to headroom {}", client.hello().version);
client.profile_use("night")?;
client.route_set("firefox", Route::Processed)?;
client.subscribe(&[Topic::Meters])?;
loop {
let event = client.next_event()?;
println!("{}/{}: {}", event.topic, event.event, event.data);
}
# Ok::<(), headroom_client::ClientError>(())
The crate is a thin layer over headroom-ipc — it
re-exports the wire types and adds a Client that owns a UnixStream,
correlates responses by id, and queues stray events received while a
request is in flight.
License
MPL-2.0. Safe to depend on from non-GPL clients.