oxilean_runtime/profiler/countingstep_traits.rs
1//! # CountingStep - Trait Implementations
2//!
3//! This module contains trait implementations for `CountingStep`.
4//!
5//! ## Implemented Traits
6//!
7//! - `ProfilingStep`
8//!
9//! 🤖 Generated with [SplitRS](https://github.com/cool-japan/splitrs)
10
11use super::functions::ProfilingStep;
12use super::types::{CountingStep, ProfilingEvent};
13
14impl ProfilingStep for CountingStep {
15 fn process(&mut self, events: &[(u64, ProfilingEvent)]) {
16 for (_, event) in events {
17 *self
18 .counts
19 .entry(Self::variant_name(event).to_string())
20 .or_insert(0) += 1;
21 }
22 }
23 fn name(&self) -> &str {
24 &self.step_name
25 }
26}