Skip to main content

TraceField

Trait TraceField 

pub trait TraceField {
    // Required methods
    fn field_type() -> FieldType;
    fn encode<W>(&self, enc: &mut EventEncoder<'_, W>) -> Result<(), Error>
       where W: Write;

    // Provided method
    fn is_optional() -> bool { ... }
}
Available on crate feature dial9 only.
Expand description

Trait for types that can be used as trace fields. Provides schema metadata (field_type), encoding (encode), and

Required Methods§

fn field_type() -> FieldType

fn encode<W>(&self, enc: &mut EventEncoder<'_, W>) -> Result<(), Error>
where W: Write,

Encode this field’s value into the event encoder.

Provided Methods§

fn is_optional() -> bool

Whether this field is optional on the wire (high-bit modifier).

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementations on Foreign Types§

§

impl TraceField for &[u8]

§

fn field_type() -> FieldType

§

fn encode<W>(&self, enc: &mut EventEncoder<'_, W>) -> Result<(), Error>
where W: Write,

§

impl TraceField for &str

§

fn field_type() -> FieldType

§

fn encode<W>(&self, enc: &mut EventEncoder<'_, W>) -> Result<(), Error>
where W: Write,

§

impl TraceField for TaskId

§

fn field_type() -> FieldType

§

fn encode<W>(&self, enc: &mut EventEncoder<'_, W>) -> Result<(), Error>
where W: Write,

§

impl TraceField for WorkerId

§

fn field_type() -> FieldType

§

fn encode<W>(&self, enc: &mut EventEncoder<'_, W>) -> Result<(), Error>
where W: Write,

§

impl TraceField for bool

§

fn field_type() -> FieldType

§

fn encode<W>(&self, enc: &mut EventEncoder<'_, W>) -> Result<(), Error>
where W: Write,

§

impl TraceField for f64

§

fn field_type() -> FieldType

§

fn encode<W>(&self, enc: &mut EventEncoder<'_, W>) -> Result<(), Error>
where W: Write,

§

impl TraceField for i64

§

fn field_type() -> FieldType

§

fn encode<W>(&self, enc: &mut EventEncoder<'_, W>) -> Result<(), Error>
where W: Write,

§

impl TraceField for u8

§

fn field_type() -> FieldType

§

fn encode<W>(&self, enc: &mut EventEncoder<'_, W>) -> Result<(), Error>
where W: Write,

§

impl TraceField for u16

§

fn field_type() -> FieldType

§

fn encode<W>(&self, enc: &mut EventEncoder<'_, W>) -> Result<(), Error>
where W: Write,

§

impl TraceField for u32

§

fn field_type() -> FieldType

§

fn encode<W>(&self, enc: &mut EventEncoder<'_, W>) -> Result<(), Error>
where W: Write,

§

impl TraceField for u64

§

fn field_type() -> FieldType

§

fn encode<W>(&self, enc: &mut EventEncoder<'_, W>) -> Result<(), Error>
where W: Write,

Implementors§