pub struct AnalyticsService { /* private fields */ }Implementations§
Source§impl AnalyticsService
impl AnalyticsService
pub fn new( db_pool: DbPool, geoip_reader: Option<GeoIpReader>, content_routing: Option<Arc<dyn ContentRouting>>, ) -> Self
pub fn extract_analytics( &self, headers: &HeaderMap, uri: Option<&Uri>, ) -> SessionAnalytics
pub fn is_bot(analytics: &SessionAnalytics) -> bool
pub fn compute_fingerprint(analytics: &SessionAnalytics) -> String
pub async fn create_analytics_session( &self, input: CreateAnalyticsSessionInput<'_>, ) -> Result<()>
pub async fn find_recent_session_by_fingerprint( &self, fingerprint: &str, max_age_seconds: i64, ) -> Result<Option<SessionRecord>>
pub const fn session_repo(&self) -> &SessionRepository
Trait Implementations§
Source§impl AnalyticsProvider for AnalyticsService
impl AnalyticsProvider for AnalyticsService
fn extract_analytics( &self, headers: &HeaderMap, uri: Option<&Uri>, ) -> TraitSessionAnalytics
fn create_session<'life0, 'life1, 'async_trait>(
&'life0 self,
input: CreateSessionInput<'life1>,
) -> Pin<Box<dyn Future<Output = AnalyticsResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn find_recent_session_by_fingerprint<'life0, 'life1, 'async_trait>(
&'life0 self,
fingerprint: &'life1 str,
max_age_seconds: i64,
) -> Pin<Box<dyn Future<Output = AnalyticsResult<Option<AnalyticsSession>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn find_session_by_id<'life0, 'life1, 'async_trait>(
&'life0 self,
session_id: &'life1 SessionId,
) -> Pin<Box<dyn Future<Output = AnalyticsResult<Option<AnalyticsSession>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn migrate_user_sessions<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
from_user_id: &'life1 UserId,
to_user_id: &'life2 UserId,
) -> Pin<Box<dyn Future<Output = AnalyticsResult<u64>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Source§impl Clone for AnalyticsService
impl Clone for AnalyticsService
Source§fn clone(&self) -> AnalyticsService
fn clone(&self) -> AnalyticsService
Returns a duplicate 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 moreAuto Trait Implementations§
impl Freeze for AnalyticsService
impl !RefUnwindSafe for AnalyticsService
impl Send for AnalyticsService
impl Sync for AnalyticsService
impl Unpin for AnalyticsService
impl !UnwindSafe for AnalyticsService
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§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more