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§

§

impl TraceField for ApplicationProtocol

§

impl TraceField for BridgeCloseReason

§

impl TraceField for Domain

§

impl TraceField for Host

§

impl TraceField for InternedStackFrames

§

impl TraceField for InternedString

§

impl TraceField for rama::tls::boring::dial9::MaybeAlpnSelected

§

impl TraceField for rama::tls::rustls::dial9::MaybeAlpnSelected

§

impl TraceField for MaybeServerName

§

impl TraceField for ProtocolVersion

§

impl TraceField for StackFrames

§

impl TraceField for String

§

impl TraceField for Vec<(String, String)>

§

impl TraceField for Vec<u8>

§

impl<T> TraceField for Option<T>
where T: TraceField,

Blanket TraceField impl for Option<T> where T: TraceField.

On the wire, the field type tag has the high bit set (0x80 | inner_tag). Encoding writes 0x00 for None or 0x01 followed by the inner value for Some. Decoding maps FieldValueRef::None to None and delegates to the inner type for present values.