Skip to main content

AttributeLike

Trait AttributeLike 

Source
pub trait AttributeLike {
    type Value: ValueLike;

    // Required methods
    fn key(&self) -> &str;
    fn value(&self) -> &Self::Value;
}
Expand description

A trait for accessing span attribute key-value pairs.

Provides methods for retrieving the key and value of a span attribute.

Required Associated Types§

Source

type Value: ValueLike

The type of the value that implements ValueLike.

Required Methods§

Source

fn key(&self) -> &str

Returns the attribute key as a string.

Source

fn value(&self) -> &Self::Value

Returns a reference to the attribute value.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<T: AttributeLike> AttributeLike for &T

Source§

type Value = <T as AttributeLike>::Value

Source§

fn key(&self) -> &str

Source§

fn value(&self) -> &Self::Value

Implementors§