[][src]Macro glean_ffi::define_metric

macro_rules! define_metric {
    ($metric_type:ident => $metric_map:ident {
        $(new -> $new_fn:ident($($new_argname:ident: $new_argtyp:ty),* $(,)*),)?
        $(test_get_num_recorded_errors -> $test_get_num_recorded_errors_fn:ident,)?
        destroy -> $destroy_fn:ident,

        $(
            $op:ident -> $op_fn:ident($($op_argname:ident: $op_argtyp:ty),* $(,)*)
        ),* $(,)*
    }) => { ... };
}

Define the global handle map, constructor and destructor functions and any user-defined functions for a new metric

This allows to define most common functionality and simple operations for a metric type. More complex operations should be written as plain functions directly.

Arguments

Additional simple functions can be define as a mapping $op -> $op_fn: