[][src]Struct glean_core::ping::PingMaker

pub struct PingMaker;

Collect a ping's data, assemble it into its full payload and store it on disk.

Methods

impl PingMaker[src]

pub fn new() -> Self[src]

Create a new PingMaker.

pub fn collect(&self, glean: &Glean, ping: &PingType) -> Option<JsonValue>[src]

Collect a snapshot for the given ping from storage and attach required meta information.

Arguments

  • glean - the Glean instance to collect data from.
  • ping - the ping to collect for.

Return value

Returns a fully assembled JSON representation of the ping payload. If there is no data stored for the ping, None is returned.

pub fn collect_string(&self, glean: &Glean, ping: &PingType) -> Option<String>[src]

Collect a snapshot for the given ping from storage and attach required meta information, returning it as a string containing JSON.

Arguments

  • glean - the Glean instance to collect data from.
  • ping - the ping to collect for.

Return value

Returns a fully assembled ping payload in a string encoded as JSON. If there is no data stored for the ping, None is returned.

pub fn store_ping(
    &self,
    doc_id: &str,
    ping_name: &str,
    data_path: &Path,
    url_path: &str,
    ping_content: &JsonValue
) -> Result<()>
[src]

Store a ping to disk in the pings directory.

pub fn clear_pending_pings(&self, data_path: &Path) -> Result<()>[src]

Clear any pending pings in the queue.

Trait Implementations

impl Default for PingMaker[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, 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.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,