1use core::marker::PhantomData;
8
9#[derive(Copy, Clone)]
11pub struct TraceResourceId<'a> {
12 #[cfg_attr(not(target_os = "fuchsia"), allow(unused))]
13 value: u64,
14 _marker: PhantomData<&'a ()>,
15}
16
17impl<'a> TraceResourceId<'a> {
18 pub fn new(value: u64) -> Self {
20 Self { value, _marker: PhantomData }
21 }
22}
23
24#[cfg(target_os = "fuchsia")]
25impl<'a> fuchsia_trace::ArgValue for TraceResourceId<'a> {
26 fn of<'x>(key: &'x str, value: Self) -> fuchsia_trace::Arg<'x>
27 where
28 Self: 'x,
29 {
30 let Self { value, _marker } = value;
31 fuchsia_trace::ArgValue::of(key, value)
32 }
33}