stage 2
This commit is contained in:
commit
ca1910de60
39 changed files with 6328 additions and 0 deletions
30
crates/headroom-client/README.md
Normal file
30
crates/headroom-client/README.md
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
# headroom-client
|
||||
|
||||
Blocking Rust client for the Headroom control protocol.
|
||||
|
||||
```rust
|
||||
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`](../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.
|
||||
Loading…
Add table
Add a link
Reference in a new issue