Trait glean_core::traits::ExtraKeys
source · 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.
Object Safety§
This trait is not object safe.