wapo/
res_id.rs

1/// Resource ID. Think of it as a FD.
2#[derive(Debug)]
3pub struct ResourceId(pub i32);
4
5impl From<i32> for ResourceId {
6    fn from(i: i32) -> Self {
7        ResourceId(i)
8    }
9}
10
11impl Drop for ResourceId {
12    fn drop(&mut self) {
13        let _ = crate::ocall::close(self.0);
14    }
15}