krata/crates/xen/xenevtchn/examples/simple.rs

13 lines
316 B
Rust
Raw Normal View History

2024-01-30 10:05:37 +00:00
use xenevtchn::error::Result;
use xenevtchn::EventChannel;
2024-01-09 01:07:00 +00:00
#[tokio::main]
async fn main() -> Result<()> {
let channel = EventChannel::open().await?;
println!("channel opened");
let port = channel.bind_unbound_port(0).await?;
2024-01-09 01:07:00 +00:00
println!("port: {}", port);
channel.unbind(port).await?;
2024-01-09 01:07:00 +00:00
Ok(())
}