pub trait RecordAttribute {
const FIELD_NAMES: &'static [&'static str];
const PLURALIZE_FIELD_NAMES: bool = false;
// Required method
fn record_attribute(&self) -> impl Value + '_;
}Expand description
Converts a value into its canonical tracing attribute representation.
Values passed to the Miden tracing span and event macros must implement this trait.
Implementations decide the allowed scalar field names, the attribute’s primitive type, and its
formatting, allowing tracing macros to use one name and representation consistently at every
recording site. Collection implementations derive their field names by appending s to these
scalar names.
Required Associated Constants§
Sourceconst FIELD_NAMES: &'static [&'static str]
const FIELD_NAMES: &'static [&'static str]
Scalar field names associated with this value’s type.
Provided Associated Constants§
Sourceconst PLURALIZE_FIELD_NAMES: bool = false
const PLURALIZE_FIELD_NAMES: bool = false
Whether the final component of each field name must have an s suffix.
Required Methods§
Sourcefn record_attribute(&self) -> impl Value + '_
fn record_attribute(&self) -> impl Value + '_
Returns the value that is passed to tracing.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementations on Foreign Types§
Source§impl RecordAttribute for AccountId
impl RecordAttribute for AccountId
const FIELD_NAMES: &'static [&'static str]
fn record_attribute(&self) -> impl Value + '_
Source§impl RecordAttribute for AccountIdPrefix
impl RecordAttribute for AccountIdPrefix
const FIELD_NAMES: &'static [&'static str]
fn record_attribute(&self) -> impl Value + '_
Source§impl RecordAttribute for BatchId
impl RecordAttribute for BatchId
const FIELD_NAMES: &'static [&'static str]
fn record_attribute(&self) -> impl Value + '_
Source§impl RecordAttribute for BlockNumber
impl RecordAttribute for BlockNumber
const FIELD_NAMES: &'static [&'static str]
fn record_attribute(&self) -> impl Value + '_
Source§impl RecordAttribute for Duration
Durations are recorded as whole milliseconds in a u64, saturating at u64::MAX.
impl RecordAttribute for Duration
Durations are recorded as whole milliseconds in a u64, saturating at u64::MAX.
Every allowed field name ends with ms so the recorded unit is visible on the query side.