Skip to main content

VariableName

Trait VariableName 

Source
pub trait VariableName {
    // Required method
    fn as_str(&self) -> &str;

    // Provided method
    fn header_name(&self) -> String { ... }
}
Expand description

Trait for typed channel variable name enums.

Implement this on variable name enums to use them with HeaderLookup::variable() and variable_str(). For variables not covered by any typed enum, use variable_str().

Required Methods§

Source

fn as_str(&self) -> &str

Wire-format variable name (e.g. "sip_call_id").

Provided Methods§

Source

fn header_name(&self) -> String

Full event header name, prefixed (e.g. "variable_sip_call_id").

For callers naming a variable with no event in hand – a config entry, a filter, a request field. Reading one out of a store is HeaderLookup::variable(), which takes the bare name.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§