Skip to main content

CallsiteRecord

Struct CallsiteRecord 

Source
pub struct CallsiteRecord {
    pub id: u64,
    pub source: CallsiteSource,
    pub target: String,
    pub name: String,
    pub module_path: String,
    pub file: String,
    pub line: Option<NonZeroU32>,
    pub sev: Severity,
    pub field_names: Vec<String>,
    pub template: String,
    pub registered_ns: u64,
    pub events_since_refresh: AtomicU64,
}
Expand description

Stable record kept per callsite_id. Spec 31 § 3.2.

Records live behind Arc<CallsiteRecord> in the registry; we never Clone one whole, so omitting Clone lets the per-record AtomicU64 event counter live in-line without indirection.

Fields§

§id: u64

64-bit BLAKE3-derived stable id.

§source: CallsiteSource

Source vocabulary.

§target: String

Tracing/forensic target (sqlx::query, myapp::auth, …).

§name: String

Display name (event src/foo.rs:42, span name, function name).

§module_path: String

Module path or empty.

§file: String

Source file path or empty.

§line: Option<NonZeroU32>

Source line; None when unavailable.

§sev: Severity

Severity / level.

§field_names: Vec<String>

Field names in stable order.

§template: String

Optional rendered template; empty for non-templated paths.

§registered_ns: u64

Wall-clock ns at registration time (used for re-emit cadence).

§events_since_refresh: AtomicU64

Approximate count of envelopes that referenced this callsite since the last refresh. Reset by re-emit cadence.

Implementations§

Source§

impl CallsiteRecord

Source

pub fn reset_count(&self)

Reset the per-cadence event counter.

Source

pub fn observe(&self) -> u64

Increment the event count and return the new value.

Trait Implementations§

Source§

impl Debug for CallsiteRecord

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.