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 moresource§impl<K> MallocSizeOf for ObjectMetric<K>
impl<K> MallocSizeOf for ObjectMetric<K>
source§impl<'a, K> MetricIdentifier<'a> for ObjectMetric<K>
impl<'a, K> MetricIdentifier<'a> for ObjectMetric<K>
source§impl<K> TestGetValue for ObjectMetric<K>
impl<K> TestGetValue for ObjectMetric<K>
Auto 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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit)§impl<T, UT> HandleAlloc<UT> for T
impl<T, UT> HandleAlloc<UT> for T
§fn new_handle(value: Arc<T>) -> Handle
fn new_handle(value: Arc<T>) -> Handle
Create a new handle for an Arc value Read more
§unsafe fn clone_handle(handle: Handle) -> Handle
unsafe fn clone_handle(handle: Handle) -> Handle
Clone a handle Read more
§unsafe fn consume_handle(handle: Handle) -> Arc<T>
unsafe fn consume_handle(handle: Handle) -> Arc<T>
Consume a handle, getting back the initial
Arc<> Read more