pub struct EventMetadata {
pub ts: u64,
pub tid: i64,
}Expand description
Metadata for an event, containing the timestamp and thread ID.
Fields§
§ts: u64Timestamp of the event in nanoseconds since the UNIX epoch.
tid: i64Thread ID of the event.
Implementations§
Source§impl EventMetadata
impl EventMetadata
Sourcepub fn timestamp(&self) -> Option<SystemTime>
pub fn timestamp(&self) -> Option<SystemTime>
Return the timestamp of the event as an Option<SystemTime>.
If the timestamp is u64::MAX, it indicates that no timestamp was set, and None is returned.
Sourcepub fn write_header<W>(
&self,
len: u32,
event_type: u16,
nparams: u32,
writer: W,
) -> Result<(), Error>where
W: Write,
pub fn write_header<W>(
&self,
len: u32,
event_type: u16,
nparams: u32,
writer: W,
) -> Result<(), Error>where
W: Write,
Write event header
To form a valid event, after calling this method, the caller must write out the payload
at exactly len - 26 bytes, containing nparam lengths (as the proper type)
and the parameter values themselves.
Sourcepub fn write_header_with_lengths<W, L, const N: usize>(
&self,
event_type: u16,
lengths: [L; N],
writer: W,
) -> Result<(), Error>
pub fn write_header_with_lengths<W, L, const N: usize>( &self, event_type: u16, lengths: [L; N], writer: W, ) -> Result<(), Error>
Write event header and parameter lengths
To form a valid event, after calling this method, the caller must write out the payload
for each parameter, lengths[i] bytes in length.
Trait Implementations§
Source§impl Clone for EventMetadata
impl Clone for EventMetadata
Source§fn clone(&self) -> EventMetadata
fn clone(&self) -> EventMetadata
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for EventMetadata
impl Debug for EventMetadata
Source§impl Default for EventMetadata
impl Default for EventMetadata
Source§fn default() -> EventMetadata
fn default() -> EventMetadata
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for EventMetadata
impl RefUnwindSafe for EventMetadata
impl Send for EventMetadata
impl Sync for EventMetadata
impl Unpin for EventMetadata
impl UnwindSafe for EventMetadata
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more