CachedClient

Struct CachedClient 

Source
pub struct CachedClient<HttpClientImpl: HttpClient, Cache: CacheHandler<HttpClientImpl::HttpError>> { /* private fields */ }

Implementations§

Source§

impl<HttpClientImpl: HttpClient, Cache: CacheHandler<HttpClientImpl::HttpError>> CachedClient<HttpClientImpl, Cache>

Source

pub fn new(client: HttpClientImpl, cache_handler: Cache) -> Self

Source§

impl<HttpClientImpl: HttpClient + Send + Sync, Cache: CacheHandler<HttpClientImpl::HttpError>> CachedClient<HttpClientImpl, Cache>

Source

pub fn make_url<T: Display>(href: &str, query_params: &[[T; 2]]) -> String

Source

pub async fn make_request<T: DeserializeOwned + Serialize>( &self, url: &str, session_id: &Option<&str>, ) -> Result<T, <Self as ErrorTrait>::Error>

Source

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>

Source

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>

Source

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>

Source

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>

Source

pub async fn fetch_general_stats( &self, ) -> Result<StatsPacket, <Self as ErrorTrait>::Error>

Source

pub async fn fetch_general_activity( &self, ) -> Result<ActivityPacket, <Self as ErrorTrait>::Error>

Source

pub async fn fetch_user_info( &self, user: &str, ) -> Result<UserInfoPacket, <Self as ErrorTrait>::Error>

Source

pub async fn fetch_user_summaries( &self, user: &str, ) -> Result<AllSummariesPacket, <Self as ErrorTrait>::Error>

Source

pub async fn fetch_user_zen_summaries( &self, user: &str, ) -> Result<ZenSummaryPacket, <Self as ErrorTrait>::Error>

Source

pub async fn fetch_user_league_summaries( &self, user: &str, ) -> Result<LeagueSummaryPacket, <Self as ErrorTrait>::Error>

Source

pub async fn fetch_user_40l_summaries( &self, user: &str, ) -> Result<SprintSummaryPacket, <Self as ErrorTrait>::Error>

Source

pub async fn fetch_user_blitz_summaries( &self, user: &str, ) -> Result<BlitzSummaryPacket, <Self as ErrorTrait>::Error>

Source

pub async fn fetch_user_zenith_summaries( &self, user: &str, ) -> Result<ZenithSummaryPacket, <Self as ErrorTrait>::Error>

Source

pub async fn fetch_user_zenithex_summaries( &self, user: &str, ) -> Result<ZenithExSummaryPacket, <Self as ErrorTrait>::Error>

Source

pub async fn fetch_user_achievements_summaries( &self, user: &str, ) -> Result<AchievementsSummaryPacket, <Self as ErrorTrait>::Error>

Source

pub async fn search_discord_user( &self, query: &str, ) -> Result<UserSearchPacket, <Self as ErrorTrait>::Error>

Source

pub async fn fetch_leaderboard( &self, leaderboard_type: LeaderboardType, query: ValueBoundQuery, session_id: Option<&str>, ) -> Result<LeaderboardPacket, <Self as ErrorTrait>::Error>

Source

pub async fn fetch_historical_leaderboard( &self, leaderboard_type: LeaderboardType, season: String, query: ValueBoundQuery, session_id: Option<&str>, ) -> Result<HistoricalLeaderboardPacket, <Self as ErrorTrait>::Error>

Source

pub async fn fetch_user_personal_40l_records( &self, user: &str, leaderboard: PersonalLeaderboard, query: PersonalRecordsQuery, ) -> Result<PersonalSprintRecordPacket, <Self as ErrorTrait>::Error>

Source

pub async fn fetch_user_personal_blitz_records( &self, user: &str, leaderboard: PersonalLeaderboard, query: PersonalRecordsQuery, ) -> Result<PersonalBlitzRecordPacket, <Self as ErrorTrait>::Error>

Source

pub async fn fetch_user_personal_league_records( &self, user: &str, leaderboard: PersonalLeaderboard, query: PersonalRecordsQuery, ) -> Result<PersonalLeagueRecordPacket, <Self as ErrorTrait>::Error>

Source

pub async fn fetch_user_personal_zenith_records( &self, user: &str, leaderboard: PersonalLeaderboard, query: PersonalRecordsQuery, ) -> Result<PersonalZenithRecordPacket, <Self as ErrorTrait>::Error>

Source

pub async fn fetch_user_personal_zenithex_records( &self, user: &str, leaderboard: PersonalLeaderboard, query: PersonalRecordsQuery, ) -> Result<PersonalZenithExRecordPacket, <Self as ErrorTrait>::Error>

Source

pub async fn fetch_news( &self, limit: Option<i64>, ) -> Result<NewsPacket, <Self as ErrorTrait>::Error>

Source

pub async fn fetch_latest_news( &self, stream: &str, limit: Option<i64>, ) -> Result<LatestNewsPacket, <Self as ErrorTrait>::Error>

Source

pub async fn fetch_scoreflow( &self, user: &str, game_mode: &str, ) -> Result<ScoreFlowPacket, <Self as ErrorTrait>::Error>

Source

pub async fn fetch_leagueflow( &self, user: &str, ) -> Result<LeagueFlowPacket, <Self as ErrorTrait>::Error>

Source

pub async fn fetch_leagueranks( &self, ) -> Result<LeagueRanksPacket, <Self as ErrorTrait>::Error>

Source

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>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<HttpClientImpl: HttpClient + Send + Sync, Cache: CacheHandler<HttpClientImpl::HttpError>> ErrorTrait for CachedClient<HttpClientImpl, Cache>

Source§

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>
where Cache: Unpin, HttpClientImpl: Unpin,

§

impl<HttpClientImpl, Cache> !UnwindSafe for CachedClient<HttpClientImpl, Cache>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,