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