1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
use crate::{Interface, Resource};
use crate::imp::GlobalInner;
pub struct Global<I: Interface + AsRef<Resource<I>> + From<Resource<I>>> {
inner: GlobalInner<I>,
}
impl<I: Interface + AsRef<Resource<I>> + From<Resource<I>>> std::fmt::Debug for Global<I> {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str("Global { ... }")
}
}
impl<I: Interface + AsRef<Resource<I>> + From<Resource<I>>> Global<I> {
pub(crate) fn create(inner: GlobalInner<I>) -> Global<I> {
Global { inner }
}
pub fn destroy(self) {
self.inner.destroy()
}
}