pub struct TraceRecord {Show 16 fields
pub provider: String,
pub model: String,
pub request_id: Option<String>,
pub session_id: Option<String>,
pub call_id: String,
pub sent_at_unix_ms: i64,
pub monotonic_sent_ms: u64,
pub lcp_token_upper: Option<u64>,
pub ttft_ms: Option<u64>,
pub fingerprint: Fingerprint,
pub usage: UsageSnapshot,
pub response_cache_headers: Option<HashMap<String, String>>,
pub request_cache_hints: Option<RequestCacheHints>,
pub verdict: Option<Verdict>,
pub error: Option<String>,
pub scope_key: u64,
}Expand description
One probed call. Plaintext never persists — fingerprints only.
Fields§
§provider: String§model: String§request_id: Option<String>§session_id: Option<String>From CallOptions.session_id (RFC-0024) — explicit first, inference
fallback; may also be the layer’s default session.
call_id: StringCall-level unique id (association key for Recording / replay, RFC-0023).
sent_at_unix_ms: i64When the call was sent (epoch ms).
monotonic_sent_ms: u64Monotonic clock ms (same domain as the store’s TTL lookups; internal bookkeeping, not part of the wire contract).
lcp_token_upper: Option<u64>Client-side LCP token upper bound (block upper bound, byte-proxy
len/4). None when no history matched. Consumed by TraceStats
aggregation.
ttft_ms: Option<u64>Time to first streamed token (ms). Non-streaming: None.
fingerprint: Fingerprint§usage: UsageSnapshot§response_cache_headers: Option<HashMap<String, String>>Response-side cache headers (e.g. x-openrouter-cache-status).
request_cache_hints: Option<RequestCacheHints>§verdict: Option<Verdict>Audit verdict (None when no auditor is attached — the default).
error: Option<String>Error string when the call failed (still recorded: failures are part of the session).
scope_key: u64Internal scope key (index only; never crosses the wire contract).
Implementations§
Source§impl TraceRecord
impl TraceRecord
Sourcepub fn reported_hit_rate(&self) -> Option<f64>
pub fn reported_hit_rate(&self) -> Option<f64>
Reported hit rate — strictly cache_read / input_total (RFC-0015
§5.2; never added to cache_write).
Sourcepub fn client_upper_bound_hit_rate(&self) -> Option<f64>
pub fn client_upper_bound_hit_rate(&self) -> Option<f64>
Client-side upper bound hit rate — token estimate / input_total.
Trait Implementations§
Source§impl Clone for TraceRecord
impl Clone for TraceRecord
Source§impl Debug for TraceRecord
impl Debug for TraceRecord
Source§impl<'de> Deserialize<'de> for TraceRecord
impl<'de> Deserialize<'de> for TraceRecord
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl Serialize for TraceRecord
impl Serialize for TraceRecord
Source§impl TS for TraceRecord
impl TS for TraceRecord
Source§type WithoutGenerics = TraceRecord
type WithoutGenerics = TraceRecord
WithoutGenerics should just be Self.
If the type does have generic parameters, then all generic parameters must be replaced with
a dummy type, e.g ts_rs::Dummy or (). The only requirement for these dummy types is that
EXPORT_TO must be None. Read moreSource§type OptionInnerType = TraceRecord
type OptionInnerType = TraceRecord
std::option::Option<T>, then this associated type is set to T.
All other implementations of TS should set this type to Self instead.Source§fn docs() -> Option<String>
fn docs() -> Option<String>
TS is derived, docs are
automatically read from your doc comments or #[doc = ".."] attributesSource§fn decl_concrete(cfg: &Config) -> String
fn decl_concrete(cfg: &Config) -> String
TS::decl().
If this type is not generic, then this function is equivalent to TS::decl().Source§fn decl(cfg: &Config) -> String
fn decl(cfg: &Config) -> String
type User = { user_id: number, ... }.
This function will panic if the type has no declaration. Read moreSource§fn inline(cfg: &Config) -> String
fn inline(cfg: &Config) -> String
{ user_id: number }.
This function will panic if the type cannot be inlined.Source§fn inline_flattened(cfg: &Config) -> String
fn inline_flattened(cfg: &Config) -> String
Source§fn visit_generics(v: &mut impl TypeVisitor)where
Self: 'static,
fn visit_generics(v: &mut impl TypeVisitor)where
Self: 'static,
Source§fn output_path() -> Option<PathBuf>
fn output_path() -> Option<PathBuf>
T should be exported, relative to the output directory.
The returned path does not include any base directory. Read moreSource§fn visit_dependencies(v: &mut impl TypeVisitor)where
Self: 'static,
fn visit_dependencies(v: &mut impl TypeVisitor)where
Self: 'static,
Source§fn dependencies(cfg: &Config) -> Vec<Dependency>where
Self: 'static,
fn dependencies(cfg: &Config) -> Vec<Dependency>where
Self: 'static,
Source§fn export(cfg: &Config) -> Result<(), ExportError>where
Self: 'static,
fn export(cfg: &Config) -> Result<(), ExportError>where
Self: 'static,
TS::export_all. Read moreSource§fn export_all(cfg: &Config) -> Result<(), ExportError>where
Self: 'static,
fn export_all(cfg: &Config) -> Result<(), ExportError>where
Self: 'static,
TS::export. Read more