pub struct EventMetric { /* private fields */ }Expand description
An event metric.
Events allow recording of e.g. individual occurences of user actions, say every time a view was open and from where. Each time you record an event, it records a timestamp, the event’s name and a set of custom values.
Implementations§
Source§impl EventMetric
 
impl EventMetric
Sourcepub fn new(meta: CommonMetricData, allowed_extra_keys: Vec<String>) -> Self
 
pub fn new(meta: CommonMetricData, allowed_extra_keys: Vec<String>) -> Self
Creates a new event metric.
Sourcepub fn record_with_time(&self, timestamp: u64, extra: HashMap<String, String>)
 
pub fn record_with_time(&self, timestamp: u64, extra: HashMap<String, String>)
Record a new event with a provided timestamp.
It’s the caller’s responsibility to ensure the timestamp comes from the same clock source.
§Arguments
- timestamp- The event timestamp, in milliseconds.
- extra- A- HashMapof- (key, value)pairs. Keys must be one of the allowed extra keys. If any key is not allowed, an error is reported and no event is recorded.
Sourcepub fn test_get_value(
    &self,
    ping_name: Option<String>,
) -> Option<Vec<RecordedEvent>>
 
pub fn test_get_value( &self, ping_name: Option<String>, ) -> Option<Vec<RecordedEvent>>
Test-only API (exported for FFI purposes).
Get the vector of currently stored events for this event metric.
This doesn’t clear the stored value.
§Arguments
- ping_name- the optional name of the ping to retrieve the metric for. Defaults to the first value in- send_in_pings.
Trait Implementations§
Source§impl Clone for EventMetric
 
impl Clone for EventMetric
Source§fn clone(&self) -> EventMetric
 
fn clone(&self) -> EventMetric
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
 
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from 
source. Read moreSource§impl Debug for EventMetric
 
impl Debug for EventMetric
Source§impl<UT> LiftRef<UT> for EventMetric
 
impl<UT> LiftRef<UT> for EventMetric
type LiftType = Arc<EventMetric>
Source§impl<UT> LowerError<UT> for EventMetric
 
impl<UT> LowerError<UT> for EventMetric
Source§fn lower_error(obj: Self) -> RustBuffer
 
fn lower_error(obj: Self) -> RustBuffer
Lower this value for scaffolding function return Read more
Source§impl<UT> LowerReturn<UT> for EventMetric
 
impl<UT> LowerReturn<UT> for EventMetric
Source§type ReturnType = <Arc<EventMetric> as LowerReturn<UniFfiTag>>::ReturnType
 
type ReturnType = <Arc<EventMetric> as LowerReturn<UniFfiTag>>::ReturnType
The type that should be returned by scaffolding functions for this type. Read more
Source§fn lower_return(obj: Self) -> Result<Self::ReturnType, RustCallError>
 
fn lower_return(obj: Self) -> Result<Self::ReturnType, RustCallError>
Lower the return value from an scaffolding call Read more
Source§fn handle_failed_lift(
    error: LiftArgsError,
) -> Result<Self::ReturnType, RustCallError>
 
fn handle_failed_lift( error: LiftArgsError, ) -> Result<Self::ReturnType, RustCallError>
Lower the return value for failed argument lifts Read more
Source§impl MetricType for EventMetric
 
impl MetricType for EventMetric
Source§impl<UT> TypeId<UT> for EventMetric
 
impl<UT> TypeId<UT> for EventMetric
Auto Trait Implementations§
impl !Freeze for EventMetric
impl RefUnwindSafe for EventMetric
impl Send for EventMetric
impl Sync for EventMetric
impl Unpin for EventMetric
impl UnwindSafe for EventMetric
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
    T: ?Sized,
 
impl<T> BorrowMut<T> for Twhere
    T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
 
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more