Struct re_analytics::Analytics
source · pub struct Analytics {
pub(crate) config: Config,
pub(crate) pipeline: Option<Pipeline>,
pub(crate) default_append_props: HashMap<Cow<'static, str>, Property>,
pub(crate) event_id: AtomicU64,
}
Fields§
§config: Config
§pipeline: Option<Pipeline>
None
if analytics are disabled.
default_append_props: HashMap<Cow<'static, str>, Property>
§event_id: AtomicU64
Implementations§
source§impl Analytics
impl Analytics
sourcepub fn new(tick: Duration) -> Result<Self, AnalyticsError>
pub fn new(tick: Duration) -> Result<Self, AnalyticsError>
Initialize an analytics pipeline which flushes events every tick
.
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
.
sourcepub(crate) fn record_raw(&self, event: AnalyticsEvent)
pub(crate) fn record_raw(&self, event: AnalyticsEvent)
Record an event.
It will be extended with an event_id
.
Auto Trait Implementations§
impl !Freeze for Analytics
impl RefUnwindSafe for Analytics
impl Send for Analytics
impl Sync for Analytics
impl Unpin 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