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
Provided Methods§
fn is_optional() -> bool
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]
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
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
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
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
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
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
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
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
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
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
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 ServerName
impl TraceField for StackFrames
impl TraceField for String
impl TraceField for ThreadStartReason
impl TraceField for ThreadStopReason
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.
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.