pub struct AnalyticsService { /* private fields */ }Expand description
Service for generating analytics and insights
Implementations§
Source§impl AnalyticsService
impl AnalyticsService
pub fn new(pool: PgPool) -> Self
Sourcepub async fn get_system_stats(&self) -> Result<SystemStats, ReputationError>
pub async fn get_system_stats(&self) -> Result<SystemStats, ReputationError>
Get overall system statistics
Sourcepub async fn get_growth_metrics(
&self,
days: i32,
) -> Result<GrowthMetrics, ReputationError>
pub async fn get_growth_metrics( &self, days: i32, ) -> Result<GrowthMetrics, ReputationError>
Get user growth metrics over time
Sourcepub async fn get_top_performers(
&self,
limit: i32,
) -> Result<Vec<UserRanking>, ReputationError>
pub async fn get_top_performers( &self, limit: i32, ) -> Result<Vec<UserRanking>, ReputationError>
Get top performers by score
Sourcepub async fn get_user_commitment_analytics(
&self,
user_id: Uuid,
) -> Result<UserCommitmentAnalytics, ReputationError>
pub async fn get_user_commitment_analytics( &self, user_id: Uuid, ) -> Result<UserCommitmentAnalytics, ReputationError>
Get commitment analytics for a specific user
Sourcepub async fn get_score_distribution(
&self,
) -> Result<ScoreDistribution, ReputationError>
pub async fn get_score_distribution( &self, ) -> Result<ScoreDistribution, ReputationError>
Get score distribution across all users
Auto 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> 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