Struct glean::private::PingType[][src]

pub struct PingType { /* fields omitted */ }

A ping is a bundle of related metrics, gathered in a payload to be transmitted.

The ping payload will be encoded in JSON format and contains shared information data.

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]

Creates a new ping type.

Arguments

  • name - The name of the ping.
  • include_client_id - Whether to include the client ID in the assembled ping when.
  • send_if_empty - Whether the ping should be sent empty or not.
  • reason_codes - The valid reason codes for this ping.

pub fn test_before_next_submit(
    &self,
    cb: impl FnOnce(Option<&str>) + Send + 'static
)
[src]

Test-only API

Attach a callback to be called right before a new ping is submitted. The provided function is called exactly once before submitting a ping.

Note: The callback will be called on any call to submit. A ping might not be sent afterwards, e.g. if the ping is otherwise empty (and send_if_empty is false).

impl PingType[src]

Trait Implementations

impl Clone for PingType[src]

impl Ping for PingType[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.