pub trait ExtraKeys {
const ALLOWED_KEYS: &'static [&'static str];
// Required method
fn into_ffi_extra(self) -> HashMap<String, String>;
}
Expand description
Extra keys for events.
Extra keys need to be pre-defined and map to a string representation.
For user-defined EventMetric
s these will be defined as struct
s.
Each extra key will be a field in that struct.
Each field will correspond to an entry in the ALLOWED_KEYS
list.
The Glean SDK requires the keys as strings for submission in pings,
whereas in code we want to provide users a type to work with
(e.g. to avoid typos or misuse of the API).
Required Associated Constants§
Sourceconst ALLOWED_KEYS: &'static [&'static str]
const ALLOWED_KEYS: &'static [&'static str]
List of allowed extra keys as strings.
Required Methods§
Sourcefn into_ffi_extra(self) -> HashMap<String, String>
fn into_ffi_extra(self) -> HashMap<String, String>
Convert the event extras into 2 lists:
- The list of extra key indices. Unset keys will be skipped.
- The list of extra values.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.