[−][src]Struct glean_core::metrics::DatetimeMetric
A datetime metric.
Used to record an absolute date and time, such as the time the user first ran the application.
Methods
impl DatetimeMetric
[src]
pub fn new(meta: CommonMetricData, time_unit: TimeUnit) -> Self
[src]
Create a new datetime metric.
pub fn set_with_details(
&self,
glean: &Glean,
year: i32,
month: u32,
day: u32,
hour: u32,
minute: u32,
second: u32,
nano: u32,
offset_seconds: i32
)
[src]
&self,
glean: &Glean,
year: i32,
month: u32,
day: u32,
hour: u32,
minute: u32,
second: u32,
nano: u32,
offset_seconds: i32
)
Public facing API for setting the metric to a date/time which includes the timezone offset.
Arguments:
glean
- the Glean instance this metric belongs to.year
- the year to set the metric to.month
- the month to set the metric to (1-12).day
- the day to set the metric to (1-based).hour
- the hour to set the metric to.minute
- the minute to set the metric to.second
- the second to set the metric to.nano
- the nanosecond fraction to the last whole second.offset_seconds
- the timezone difference, in seconds, for the Eastern Hemisphere. Negative seconds mean Western Hemisphere.
pub fn set(&self, glean: &Glean, value: Option<DateTime<FixedOffset>>)
[src]
Public facing API for setting the metric to a date/time which includes the timezone offset.
Arguments:
glean
- the Glean instance this metric belongs to.value
- Some date/time value, with offset, to set the metric to. If none, the current local time is used.
pub fn test_get_value_as_string(
&self,
glean: &Glean,
storage_name: &str
) -> Option<String>
[src]
&self,
glean: &Glean,
storage_name: &str
) -> Option<String>
Test-only API (exported for FFI purposes).
Get the currently stored value as a String.
The precision of this value is truncated to the time_unit
precision.
This doesn't clear the stored value.
Trait Implementations
impl Debug for DatetimeMetric
[src]
impl MetricType for DatetimeMetric
[src]
fn meta(&self) -> &CommonMetricData
[src]
fn meta_mut(&mut self) -> &mut CommonMetricData
[src]
fn should_record(&self, glean: &Glean) -> bool
[src]
Auto Trait Implementations
impl RefUnwindSafe for DatetimeMetric
impl Send for DatetimeMetric
impl Sync for DatetimeMetric
impl Unpin for DatetimeMetric
impl UnwindSafe for DatetimeMetric
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>,