pub struct WriteMetrics<'a, R: BattleRules> { /* private fields */ }
Expand description
Handle to write metrics.
Implementations§
Source§impl<'a, R: BattleRules> WriteMetrics<'a, R>
impl<'a, R: BattleRules> WriteMetrics<'a, R>
Sourcepub fn remove_user(&mut self, id: UserMetricId<R>)
pub fn remove_user(&mut self, id: UserMetricId<R>)
Removes an user metric.
Sourcepub fn add_user_u64(
&mut self,
id: UserMetricId<R>,
value: u64,
) -> WeaselResult<(), R>
pub fn add_user_u64( &mut self, id: UserMetricId<R>, value: u64, ) -> WeaselResult<(), R>
Adds value
to the user metric with the given id
.\
Creates the metric (initialized with value
) if it doesn’t exist.
Returns an error if the metric exists, but its type is different.
Sourcepub fn add_user_i64(
&mut self,
id: UserMetricId<R>,
value: i64,
) -> WeaselResult<(), R>
pub fn add_user_i64( &mut self, id: UserMetricId<R>, value: i64, ) -> WeaselResult<(), R>
Adds value
to the user metric with the given id
.\
Creates the metric (initialized with value
) if it doesn’t exist.
Returns an error if the metric exists, but its type is different.
Sourcepub fn add_user_f64(
&mut self,
id: UserMetricId<R>,
value: f64,
) -> WeaselResult<(), R>
pub fn add_user_f64( &mut self, id: UserMetricId<R>, value: f64, ) -> WeaselResult<(), R>
Adds value
to the user metric with the given id
.\
Creates the metric (initialized with value
) if it doesn’t exist.
Returns an error if the metric exists, but its type is different.
Auto Trait Implementations§
impl<'a, R> Freeze for WriteMetrics<'a, R>
impl<'a, R> RefUnwindSafe for WriteMetrics<'a, R>
impl<'a, R> Send for WriteMetrics<'a, R>
impl<'a, R> Sync for WriteMetrics<'a, R>
impl<'a, R> Unpin for WriteMetrics<'a, R>
impl<'a, R> !UnwindSafe for WriteMetrics<'a, R>
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