Struct glean::private::ObjectMetric
source · pub struct ObjectMetric<K> { /* private fields */ }
Expand description
Developer-facing API for recording object metrics.
Instances of this class type are automatically generated by the parsers at build time, allowing developers to record values that were previously registered in the metrics.yaml file.
Implementations§
source§impl<K: ObjectSerialize> ObjectMetric<K>
impl<K: ObjectSerialize> ObjectMetric<K>
sourcepub fn new(meta: CommonMetricData) -> Self
pub fn new(meta: CommonMetricData) -> Self
The public constructor used by automatically generated metrics.
sourcepub fn set_string(&self, object: String)
pub fn set_string(&self, object: String)
Sets to the specified structure.
Parses the passed JSON string. If it can’t be parsed into a valid object it records an invalid value error.
§Arguments
object
- JSON representation of the object to set.
Trait Implementations§
source§impl<K: Clone> Clone for ObjectMetric<K>
impl<K: Clone> Clone for ObjectMetric<K>
source§fn clone(&self) -> ObjectMetric<K>
fn clone(&self) -> ObjectMetric<K>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl<K> Freeze for ObjectMetric<K>
impl<K> RefUnwindSafe for ObjectMetric<K>where
K: RefUnwindSafe,
impl<K> Send for ObjectMetric<K>where
K: Send,
impl<K> Sync for ObjectMetric<K>where
K: Sync,
impl<K> Unpin for ObjectMetric<K>where
K: Unpin,
impl<K> UnwindSafe for ObjectMetric<K>where
K: UnwindSafe,
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T, UT> HandleAlloc<UT> for T
impl<T, UT> HandleAlloc<UT> for T
source§fn consume_handle(handle: Handle) -> Arc<T>
fn consume_handle(handle: Handle) -> Arc<T>
Consume a handle, getting back the initial
Arc<>