Skip to main content

Module trace

Module trace 

Source
Expand description

Field-shaped accessors for #[tracing::instrument(fields(...))].

Each function wraps a single VMI accessor so it returns a primitive Option<T> instead of Result<Newtype<T>, VmiError>.

  • Errors collapse to None, which drops the field from the span instead of poisoning it with an error string.
  • Newtype wrappers like ProcessId(u32) and View(u16) unwrap to their inner primitive, so structured-output subscribers emit a number rather than a Debug-formatted struct.

§Examples

#[tracing::instrument(
    skip_all,
    fields(
        view = vmi::trace::event_view(vmi.event()),
        pid  = vmi::trace::current_process_id(vmi),
        tid  = vmi::trace::current_thread_id(vmi),
    )
)]
fn dispatch(...) { ... }

Structs§

Hex
A hexadecimal representation of a value.

Functions§

current_process_id
Returns the process ID of the current process, if available.
current_process_name
Returns the name of the current process, if available.
current_thread_id
Returns the thread ID of the current thread, if available.
event_view
Returns the view of the given event, if available.
process_id
Returns the process ID of the given process, if available.
process_name
Returns the name of the process, if available.
thread_id
Returns the thread ID of the given thread, if available.
user_module_name
Returns the name of the given user module, if available.