Trait glean::traits::ExtraKeys [−][src]
pub trait ExtraKeys: Hash + Eq + PartialEq<Self> + Copy { pub const ALLOWED_KEYS: &'static [&'static str]; pub fn index(self) -> i32; }
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 enums
.
Each variant 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).
Associated Constants
pub const ALLOWED_KEYS: &'static [&'static str]
[src]
List of allowed extra keys as strings.
Required methods
pub fn index(self) -> i32
[src]
The index of the extra key.
It corresponds to its position in the associated ALLOWED_KEYS
list.
Note: An index of -1
indicates an invalid / non-existing extra key.
Invalid / non-existing extra keys will be recorded as an error.
This cannot happen for generated code.
Implementors
impl ExtraKeys for NoExtraKeys
[src]
impl ExtraKeys for NoExtraKeys
[src]