pub struct Analytics { /* private fields */ }Implementations§
Source§impl Analytics
impl Analytics
Sourcepub fn global_or_init() -> Option<&'static Self>
pub fn global_or_init() -> Option<&'static Self>
Get the global analytics instance, initializing it if it’s not already initialized.
Return None if analytics is disabled or some error occurred.
Sourcepub fn global_get() -> Option<&'static Self>
pub fn global_get() -> Option<&'static Self>
Get the global analytics instance, but only if it has already been initialized with Self::global_or_init.
Return None if analytics is disabled or some error occurred during initialization.
Usually it is better to use Self::global_or_init instead.
pub fn config(&self) -> &Config
Sourcepub fn record<E: Event>(&self, event: E)
pub fn record<E: Event>(&self, event: E)
Record a single event.
The event is constructed using the implementations of Event and Properties.
The event’s properties will be extended with an event_id.
pub fn flush_blocking(&self, timeout: Duration) -> Result<(), FlushError>
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Analytics
impl RefUnwindSafe for Analytics
impl Send for Analytics
impl Sync for Analytics
impl Unpin for Analytics
impl UnsafeUnpin for Analytics
impl UnwindSafe for Analytics
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