[−][src]Struct glean_core::metrics::PingType
Stores information about a ping.
This is required so that given metric data queued on disk we can send pings with the correct settings, e.g. whether it has a client_id.
Fields
name: String
The name of the ping.
include_client_id: bool
Whether the ping should include the client ID.
send_if_empty: bool
Whether the ping should be sent if it is empty
reason_codes: Vec<String>
The "reason" codes that this ping can send
Implementations
impl PingType
[src]
pub fn new<A: Into<String>>(
name: A,
include_client_id: bool,
send_if_empty: bool,
reason_codes: Vec<String>
) -> Self
[src]
name: A,
include_client_id: bool,
send_if_empty: bool,
reason_codes: Vec<String>
) -> Self
Create a new ping type for the given name, whether to include the client ID and whether to send this ping empty.
Arguments
name
- The name of the ping.include_client_id
- Whether to include the client ID in the assembled ping when submitting.send_if_empty
- Whether the ping should be sent empty or not.reason_codes
- The valid reason codes for this ping.
pub fn submit(&self, glean: &Glean, reason: Option<&str>) -> Result<bool>
[src]
Submit the ping for eventual uploading
Arguments
glean
- the Glean instance to use to send the ping.reason
- the reason the ping was triggered. Included in theping_info.reason
part of the payload.
Return value
See Glean#submit_ping
for details.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for PingType
impl Send for PingType
impl Sync for PingType
impl Unpin for PingType
impl UnwindSafe for PingType
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,