🛈 Note: This is pre-release documentation for the upcoming tracing 0.2.0 ecosystem.

For the release documentation, please see docs.rs, instead.

Struct Field

pub struct Field { /* private fields */ }
Expand description

An opaque key allowing O(1) access to a field in a Span’s key-value data.

As keys are defined by the metadata of a span, rather than by an individual instance of a span, a key may be used to access the same field across all instances of a given span with the same metadata. Thus, when a collector observes a new span, it need only access a field by name once, and use the key for that name for all other accesses.

Implementations§

§

impl Field

pub fn callsite(&self) -> Identifier

Returns an Identifier that uniquely identifies the Callsite which defines this field.

pub fn name(&self) -> &'static str

Returns a string representing the name of the field.

pub fn index(&self) -> usize

Returns the index of this field in its FieldSet.

Trait Implementations§

Source§

impl AsField for &Field

Source§

fn as_field(&self, metadata: &Metadata<'_>) -> Option<Field>

Attempts to convert &self into a Field with the specified metadata. Read more
Source§

impl AsField for Field

Source§

fn as_field(&self, metadata: &Metadata<'_>) -> Option<Field>

Attempts to convert &self into a Field with the specified metadata. Read more
§

impl AsRef<str> for Field

§

fn as_ref(&self) -> &str

Converts this type into a shared reference of the (usually inferred) input type.
§

impl Clone for Field

§

fn clone(&self) -> Field

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl Debug for Field

§

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

Formats the value using the given formatter. Read more
§

impl Display for Field

§

fn fmt(&self, f: &mut