Struct glean_core::metrics::PingType[][src]

pub struct PingType {
    pub name: String,
    pub include_client_id: bool,
    pub send_if_empty: bool,
    pub reason_codes: Vec<String>,
}
Expand description

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

Creates 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.

Submits 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 the ping_info.reason part of the payload.

Returns

See Glean::submit_ping for details.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.