glean_core/traits/
ping.rs

1// This Source Code Form is subject to the terms of the Mozilla Public
2// License, v. 2.0. If a copy of the MPL was not distributed with this
3// file, You can obtain one at https://mozilla.org/MPL/2.0/.
4
5/// A description for the [`PingType`](crate::metrics::PingType) type.
6///
7/// When changing this trait, make sure all the operations are
8/// implemented in the related type in `../metrics/`.
9pub trait Ping {
10    /// Submits the ping for eventual uploading
11    ///
12    /// # Arguments
13    ///
14    /// * `reason` - the reason the ping was triggered. Included in the
15    ///   `ping_info.reason` part of the payload.
16    fn submit(&self, reason: Option<&str>);
17}