krata/libs/xen/xenevtchn/examples/simple.rs
2024-02-15 17:55:39 +00:00

13 lines
316 B
Rust

use xenevtchn::error::Result;
use xenevtchn::EventChannel;
#[tokio::main]
async fn main() -> Result<()> {
let channel = EventChannel::open().await?;
println!("channel opened");
let port = channel.bind_unbound_port(0).await?;
println!("port: {}", port);
channel.unbind(port).await?;
Ok(())
}