pub struct CachedClient<HttpClientImpl: HttpClient, Cache: CacheHandler<HttpClientImpl::HttpError>> { /* private fields */ }Implementations§
Source§impl<HttpClientImpl: HttpClient, Cache: CacheHandler<HttpClientImpl::HttpError>> CachedClient<HttpClientImpl, Cache>
impl<HttpClientImpl: HttpClient, Cache: CacheHandler<HttpClientImpl::HttpError>> CachedClient<HttpClientImpl, Cache>
Source§impl<HttpClientImpl: HttpClient + Send + Sync, Cache: CacheHandler<HttpClientImpl::HttpError>> CachedClient<HttpClientImpl, Cache>
impl<HttpClientImpl: HttpClient + Send + Sync, Cache: CacheHandler<HttpClientImpl::HttpError>> CachedClient<HttpClientImpl, Cache>
pub fn make_url<T: Display>(href: &str, query_params: &[[T; 2]]) -> String
pub async fn make_request<T: DeserializeOwned + Serialize>( &self, url: &str, session_id: &Option<&str>, ) -> Result<T, <Self as ErrorTrait>::Error>
pub async fn cache_value_if_success<T: DeserializeOwned + Serialize + Send + Sync>( &self, cache_key: String, r: Packet<T>, ) -> Result<bool, <Self as ErrorTrait>::Error>
pub async fn make_tetrio_api_request<T: DeserializeOwned + Serialize + Send + Sync + Clone>( &self, route: impl Display, session_id: Option<&str>, ) -> Result<Packet<T>, <Self as ErrorTrait>::Error>
pub async fn cache_tetrio_api_result_if_not_present<T: DeserializeOwned + Serialize + Clone + Send + Sync>( &self, route: impl Display, session_id: Option<&str>, packet: &str, ) -> Result<Packet<T>, <Self as ErrorTrait>::Error>
pub async fn get_from_cache<T: DeserializeOwned + Serialize + Clone + Send + Sync>( &self, route: impl Display, session_id: Option<&str>, ) -> Result<Option<Packet<T>>, <Self as ErrorTrait>::Error>
pub async fn fetch_general_stats( &self, ) -> Result<StatsPacket, <Self as ErrorTrait>::Error>
pub async fn fetch_general_activity( &self, ) -> Result<ActivityPacket, <Self as ErrorTrait>::Error>
pub async fn fetch_user_info( &self, user: &str, ) -> Result<UserInfoPacket, <Self as ErrorTrait>::Error>
pub async fn fetch_user_summaries( &self, user: &str, ) -> Result<AllSummariesPacket, <Self as ErrorTrait>::Error>
pub async fn fetch_user_zen_summaries( &self, user: &str, ) -> Result<ZenSummaryPacket, <Self as ErrorTrait>::Error>
pub async fn fetch_user_league_summaries( &self, user: &str, ) -> Result<LeagueSummaryPacket, <Self as ErrorTrait>::Error>
pub async fn fetch_user_40l_summaries( &self, user: &str, ) -> Result<SprintSummaryPacket, <Self as ErrorTrait>::Error>
pub async fn fetch_user_blitz_summaries( &self, user: &str, ) -> Result<BlitzSummaryPacket, <Self as ErrorTrait>::Error>
pub async fn fetch_user_zenith_summaries( &self, user: &str, ) -> Result<ZenithSummaryPacket, <Self as ErrorTrait>::Error>
pub async fn fetch_user_zenithex_summaries( &self, user: &str, ) -> Result<ZenithExSummaryPacket, <Self as ErrorTrait>::Error>
pub async fn fetch_user_achievements_summaries( &self, user: &str, ) -> Result<AchievementsSummaryPacket, <Self as ErrorTrait>::Error>
pub async fn search_discord_user( &self, query: &str, ) -> Result<UserSearchPacket, <Self as ErrorTrait>::Error>
pub async fn fetch_leaderboard( &self, leaderboard_type: LeaderboardType, query: ValueBoundQuery, session_id: Option<&str>, ) -> Result<LeaderboardPacket, <Self as ErrorTrait>::Error>
pub async fn fetch_historical_leaderboard( &self, leaderboard_type: LeaderboardType, season: String, query: ValueBoundQuery, session_id: Option<&str>, ) -> Result<HistoricalLeaderboardPacket, <Self as ErrorTrait>::Error>
pub async fn fetch_user_personal_40l_records( &self, user: &str, leaderboard: PersonalLeaderboard, query: PersonalRecordsQuery, ) -> Result<PersonalSprintRecordPacket, <Self as ErrorTrait>::Error>
pub async fn fetch_user_personal_blitz_records( &self, user: &str, leaderboard: PersonalLeaderboard, query: PersonalRecordsQuery, ) -> Result<PersonalBlitzRecordPacket, <Self as ErrorTrait>::Error>
pub async fn fetch_user_personal_league_records( &self, user: &str, leaderboard: PersonalLeaderboard, query: PersonalRecordsQuery, ) -> Result<PersonalLeagueRecordPacket, <Self as ErrorTrait>::Error>
pub async fn fetch_user_personal_zenith_records( &self, user: &str, leaderboard: PersonalLeaderboard, query: PersonalRecordsQuery, ) -> Result<PersonalZenithRecordPacket, <Self as ErrorTrait>::Error>
pub async fn fetch_user_personal_zenithex_records( &self, user: &str, leaderboard: PersonalLeaderboard, query: PersonalRecordsQuery, ) -> Result<PersonalZenithExRecordPacket, <Self as ErrorTrait>::Error>
pub async fn fetch_news( &self, limit: Option<i64>, ) -> Result<NewsPacket, <Self as ErrorTrait>::Error>
pub async fn fetch_latest_news( &self, stream: &str, limit: Option<i64>, ) -> Result<LatestNewsPacket, <Self as ErrorTrait>::Error>
pub async fn fetch_scoreflow( &self, user: &str, game_mode: &str, ) -> Result<ScoreFlowPacket, <Self as ErrorTrait>::Error>
pub async fn fetch_leagueflow( &self, user: &str, ) -> Result<LeagueFlowPacket, <Self as ErrorTrait>::Error>
pub async fn fetch_leagueranks( &self, ) -> Result<LeagueRanksPacket, <Self as ErrorTrait>::Error>
pub async fn fetch_achievement_info( &self, achievement: &str, ) -> Result<AchievementInfoPacket, <Self as ErrorTrait>::Error>
Trait Implementations§
Source§impl<HttpClientImpl: HttpClient + Default, Cache: CacheHandler<HttpClientImpl::HttpError> + Default> Default for CachedClient<HttpClientImpl, Cache>
impl<HttpClientImpl: HttpClient + Default, Cache: CacheHandler<HttpClientImpl::HttpError> + Default> Default for CachedClient<HttpClientImpl, Cache>
Source§impl<HttpClientImpl: HttpClient + Send + Sync, Cache: CacheHandler<HttpClientImpl::HttpError>> ErrorTrait for CachedClient<HttpClientImpl, Cache>
impl<HttpClientImpl: HttpClient + Send + Sync, Cache: CacheHandler<HttpClientImpl::HttpError>> ErrorTrait for CachedClient<HttpClientImpl, Cache>
type Error = Error<<HttpClientImpl as HttpClient>::HttpError, <Cache as CacheHandler<<HttpClientImpl as HttpClient>::HttpError>>::CachingError>
Auto Trait Implementations§
impl<HttpClientImpl, Cache> !Freeze for CachedClient<HttpClientImpl, Cache>
impl<HttpClientImpl, Cache> !RefUnwindSafe for CachedClient<HttpClientImpl, Cache>
impl<HttpClientImpl, Cache> Send for CachedClient<HttpClientImpl, Cache>where
Cache: Send,
impl<HttpClientImpl, Cache> Sync for CachedClient<HttpClientImpl, Cache>where
Cache: Sync,
impl<HttpClientImpl, Cache> Unpin for CachedClient<HttpClientImpl, Cache>
impl<HttpClientImpl, Cache> !UnwindSafe for CachedClient<HttpClientImpl, Cache>
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