pub trait AnalyticsStorage: Send + Sync {
// Required methods
fn store_follower_snapshot<'life0, 'async_trait>(
&'life0 self,
followers: i64,
following: i64,
tweets: i64,
) -> Pin<Box<dyn Future<Output = Result<(), AnalyticsError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn get_yesterday_followers<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Option<i64>, AnalyticsError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn get_replies_needing_measurement<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<String>, AnalyticsError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn get_tweets_needing_measurement<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<String>, AnalyticsError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn store_reply_performance<'life0, 'life1, 'async_trait>(
&'life0 self,
reply_id: &'life1 str,
likes: i64,
replies: i64,
impressions: i64,
score: f64,
) -> Pin<Box<dyn Future<Output = Result<(), AnalyticsError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn store_tweet_performance<'life0, 'life1, 'async_trait>(
&'life0 self,
tweet_id: &'life1 str,
likes: i64,
retweets: i64,
replies: i64,
impressions: i64,
score: f64,
) -> Pin<Box<dyn Future<Output = Result<(), AnalyticsError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn update_content_score<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
topic: &'life1 str,
format: &'life2 str,
score: f64,
) -> Pin<Box<dyn Future<Output = Result<(), AnalyticsError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
fn log_action<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
action_type: &'life1 str,
status: &'life2 str,
message: &'life3 str,
) -> Pin<Box<dyn Future<Output = Result<(), AnalyticsError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait;
}Expand description
Storage operations for analytics data.
Required Methods§
Sourcefn store_follower_snapshot<'life0, 'async_trait>(
&'life0 self,
followers: i64,
following: i64,
tweets: i64,
) -> Pin<Box<dyn Future<Output = Result<(), AnalyticsError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn store_follower_snapshot<'life0, 'async_trait>(
&'life0 self,
followers: i64,
following: i64,
tweets: i64,
) -> Pin<Box<dyn Future<Output = Result<(), AnalyticsError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Store a daily follower snapshot.
Sourcefn get_yesterday_followers<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Option<i64>, AnalyticsError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_yesterday_followers<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Option<i64>, AnalyticsError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get yesterday’s follower count (for drop detection).
Sourcefn get_replies_needing_measurement<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<String>, AnalyticsError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_replies_needing_measurement<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<String>, AnalyticsError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get reply IDs posted approximately 24h ago that need performance measurement.
Sourcefn get_tweets_needing_measurement<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<String>, AnalyticsError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_tweets_needing_measurement<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<String>, AnalyticsError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get tweet IDs posted approximately 24h ago that need performance measurement.
Sourcefn store_reply_performance<'life0, 'life1, 'async_trait>(
&'life0 self,
reply_id: &'life1 str,
likes: i64,
replies: i64,
impressions: i64,
score: f64,
) -> Pin<Box<dyn Future<Output = Result<(), AnalyticsError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn store_reply_performance<'life0, 'life1, 'async_trait>(
&'life0 self,
reply_id: &'life1 str,
likes: i64,
replies: i64,
impressions: i64,
score: f64,
) -> Pin<Box<dyn Future<Output = Result<(), AnalyticsError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Store reply performance metrics.
Sourcefn store_tweet_performance<'life0, 'life1, 'async_trait>(
&'life0 self,
tweet_id: &'life1 str,
likes: i64,
retweets: i64,
replies: i64,
impressions: i64,
score: f64,
) -> Pin<Box<dyn Future<Output = Result<(), AnalyticsError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn store_tweet_performance<'life0, 'life1, 'async_trait>(
&'life0 self,
tweet_id: &'life1 str,
likes: i64,
retweets: i64,
replies: i64,
impressions: i64,
score: f64,
) -> Pin<Box<dyn Future<Output = Result<(), AnalyticsError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Store tweet performance metrics.
Sourcefn update_content_score<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
topic: &'life1 str,
format: &'life2 str,
score: f64,
) -> Pin<Box<dyn Future<Output = Result<(), AnalyticsError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn update_content_score<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
topic: &'life1 str,
format: &'life2 str,
score: f64,
) -> Pin<Box<dyn Future<Output = Result<(), AnalyticsError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Update the content score running average for a topic.
Sourcefn log_action<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
action_type: &'life1 str,
status: &'life2 str,
message: &'life3 str,
) -> Pin<Box<dyn Future<Output = Result<(), AnalyticsError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn log_action<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
action_type: &'life1 str,
status: &'life2 str,
message: &'life3 str,
) -> Pin<Box<dyn Future<Output = Result<(), AnalyticsError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Log an action.