usbvfiod 0.2.0

A vfio-user server for USB pass-through.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
use anyhow::anyhow;
use tokio::sync::oneshot;

pub trait SendWithAnyhowError<T> {
    fn send_anyhow(self, msg: T) -> anyhow::Result<()>;
}

impl<T> SendWithAnyhowError<T> for oneshot::Sender<T> {
    fn send_anyhow(self, msg: T) -> anyhow::Result<()> {
        self.send(msg)
            .map_err(|_| anyhow!("oneshot channel closed"))
    }
}