[−][src]Struct glean_core::ping::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,
reason: Option<&str>
) -> Option<JsonValue>
[src]
&self,
glean: &Glean,
ping: &PingType,
reason: Option<&str>
) -> Option<JsonValue>
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.reason
- an optional reason code to include in the ping.
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,
reason: Option<&str>
) -> Option<String>
[src]
&self,
glean: &Glean,
ping: &PingType,
reason: Option<&str>
) -> Option<String>
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.reason
- an optional reason code to include in the ping.
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]
&self,
doc_id: &str,
ping_name: &str,
data_path: &Path,
url_path: &str,
ping_content: &JsonValue
) -> Result<()>
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
Auto Trait Implementations
impl RefUnwindSafe for PingMaker
impl Send for PingMaker
impl Sync for PingMaker
impl Unpin for PingMaker
impl UnwindSafe for PingMaker
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, 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>,