---
source: dial9-trace-format-derive/src/lib.rs
expression: "expand_to_string(quote!\n{ struct EmptyEvent { #[traceevent(timestamp)] timestamp_ns: u64, } })"
---
#[derive(Debug, Clone)]
struct EmptyEventRef<'a> {
    pub timestamp_ns: u64,
    _marker: ::std::marker::PhantomData<&'a ()>,
}
impl ::dial9_trace_format::TraceEvent for EmptyEvent {
    type Ref<'a> = EmptyEventRef<'a>;
    fn event_name() -> &'static str {
        "EmptyEvent"
    }
    fn field_defs() -> Vec<::dial9_trace_format::schema::FieldDef> {
        vec![]
    }
    fn timestamp(&self) -> u64 {
        self.timestamp_ns
    }
    fn encode_fields<W: ::std::io::Write>(
        &self,
        enc: &mut ::dial9_trace_format::EventEncoder<'_, W>,
    ) -> ::std::io::Result<()> {
        Ok(())
    }
    fn decode<'a>(
        timestamp_ns: Option<u64>,
        fields: &[::dial9_trace_format::types::FieldValueRef<'a>],
        field_defs: &[::dial9_trace_format::schema::FieldDef],
    ) -> Option<Self::Ref<'a>> {
        Some(EmptyEventRef {
            timestamp_ns: timestamp_ns?,
            _marker: ::std::marker::PhantomData,
        })
    }
}
