pub struct NadeoClient {
pub user_agent: UserAgentDetails,
pub max_concurrent_requests: usize,
/* private fields */
}Fields§
§user_agent: UserAgentDetails§max_concurrent_requests: usizeImplementations§
Source§impl NadeoClient
impl NadeoClient
pub fn get_authz_header_for_auth(&self) -> String
pub async fn create( credentials: NadeoCredentials, user_agent: UserAgentDetails, max_concurrent_requests: usize, ) -> Result<Self, Box<dyn Error>>
pub fn with_oauth(self, oauth: OAuthCredentials) -> Option<Self>
pub async fn ensure_tokens_valid(&self)
pub async fn calc_avg_req_per_sec(&self) -> f64
pub async fn get_cached_avg_req_per_sec(&self) -> f64
pub async fn get_nb_reqs(&self) -> usize
pub fn get_batcher(&self) -> &BatcherLbPosByTime
Trait Implementations§
Source§impl CoreApiClient for NadeoClient
impl CoreApiClient for NadeoClient
Source§impl LiveApiClient for NadeoClient
impl LiveApiClient for NadeoClient
Source§async fn push_rec_position_req(
&'static self,
map_uid: &str,
score: i32,
) -> Receiver<ScoreToPos>
async fn push_rec_position_req( &'static self, map_uid: &str, score: i32, ) -> Receiver<ScoreToPos>
Internal method supporting
get_lb_position_by_time_batchedSource§async fn get_monthly_campaign(
&self,
ty: MonthlyCampaignType,
length: u32,
offset: u32,
) -> Result<MonthlyCampaign_List, Box<dyn Error>>
async fn get_monthly_campaign( &self, ty: MonthlyCampaignType, length: u32, offset: u32, ) -> Result<MonthlyCampaign_List, Box<dyn Error>>
Get TOTDs / Royal maps
Source§async fn get_map_group_leaderboard(
&self,
group_uid: &str,
map_uid: &str,
only_world: bool,
length: u32,
offset: u32,
) -> Result<MapGroupLeaderboard, Box<dyn Error>>
async fn get_map_group_leaderboard( &self, group_uid: &str, map_uid: &str, only_world: bool, length: u32, offset: u32, ) -> Result<MapGroupLeaderboard, Box<dyn Error>>
Source§async fn get_map_leaderboard(
&self,
map_uid: &str,
only_world: bool,
length: u32,
offset: u32,
) -> Result<MapGroupLeaderboard, Box<dyn Error>>
async fn get_map_leaderboard( &self, map_uid: &str, only_world: bool, length: u32, offset: u32, ) -> Result<MapGroupLeaderboard, Box<dyn Error>>
Personal_Best LB Read more
Source§async fn get_lb_positions_by_time(
&self,
uid_scores: &[(&str, NonZero<u32>)],
) -> Result<Vec<RecordsByTime>, Box<dyn Error>>
async fn get_lb_positions_by_time( &self, uid_scores: &[(&str, NonZero<u32>)], ) -> Result<Vec<RecordsByTime>, Box<dyn Error>>
Source§async fn get_lb_positions_by_time_group(
&self,
uid_scores: &[(&str, NonZero<u32>)],
group_uid: &str,
) -> Result<Vec<RecordsByTime>, Box<dyn Error>>
async fn get_lb_positions_by_time_group( &self, uid_scores: &[(&str, NonZero<u32>)], group_uid: &str, ) -> Result<Vec<RecordsByTime>, Box<dyn Error>>
Source§async fn get_lb_position_by_time_batched(
&'static self,
map_uid: &str,
score: NonZero<u32>,
) -> Result<ScoreToPos, RecvError>
async fn get_lb_position_by_time_batched( &'static self, map_uid: &str, score: NonZero<u32>, ) -> Result<ScoreToPos, RecvError>
Source§async fn get_group_surround(
&self,
group_uid: &str,
map_uid: &str,
lower: i32,
upper: i32,
score: u32,
only_world: bool,
) -> Result<RecordsSurround, Box<dyn Error>>
async fn get_group_surround( &self, group_uid: &str, map_uid: &str, lower: i32, upper: i32, score: u32, only_world: bool, ) -> Result<RecordsSurround, Box<dyn Error>>
Source§async fn get_pb_surround(
&self,
map_uid: &str,
lower: i32,
upper: i32,
score: u32,
only_world: bool,
) -> Result<RecordsSurround, Box<dyn Error>>
async fn get_pb_surround( &self, map_uid: &str, lower: i32, upper: i32, score: u32, only_world: bool, ) -> Result<RecordsSurround, Box<dyn Error>>
Surround on the Personal_Best group Read more
Source§impl MeetApiClient for NadeoClient
impl MeetApiClient for NadeoClient
Source§async fn get_cup_of_the_day(
&self,
) -> Result<Option<CupOfTheDay>, Box<dyn Error>>
async fn get_cup_of_the_day( &self, ) -> Result<Option<CupOfTheDay>, Box<dyn Error>>
Source§impl NadeoApiClient for NadeoClient
impl NadeoApiClient for NadeoClient
Source§fn get_auth_token(
&self,
audience: NadeoAudience,
) -> Result<String, TryLockError>
fn get_auth_token( &self, audience: NadeoAudience, ) -> Result<String, TryLockError>
prefer aget_auth_token
async fn get_client(&self) -> &Client
async fn aget_auth_token(&self, audience: NadeoAudience) -> String
async fn rate_limit(&self) -> SemaphorePermit<'_>
async fn get_file_size(&self, url: &str) -> Result<u64, RqError>
fn get_auth_header(&self, audience: NadeoAudience) -> String
async fn aget_auth_header(&self, audience: NadeoAudience) -> String
async fn get_auth_header_value(&self, audience: NadeoAudience) -> HeaderValue
async fn oauth_get<'a>( &self, path: &str, token: &OAuthToken, _permit: &SemaphorePermit<'a>, ) -> RequestBuilder
async fn core_get(&self, path: &str) -> (RequestBuilder, SemaphorePermit<'_>)
async fn run_core_get(&self, path: &str) -> Result<Value, RqError>
async fn core_post_bytes( &self, path: &str, body: &[u8], ) -> (RequestBuilder, SemaphorePermit<'_>)
async fn run_core_post_bytes( &self, path: &str, body: &[u8], ) -> Result<Value, RqError>
async fn core_post( &self, path: &str, body: &Value, ) -> (RequestBuilder, SemaphorePermit<'_>)
async fn run_core_post( &self, path: &str, body: &Value, ) -> Result<Value, RqError>
async fn live_get(&self, path: &str) -> (RequestBuilder, SemaphorePermit<'_>)
async fn run_live_get(&self, path: &str) -> Result<Value, RqError>
async fn live_post_bytes( &self, path: &str, body: &[u8], ) -> (RequestBuilder, SemaphorePermit<'_>)
async fn run_live_post_bytes( &self, path: &str, body: &[u8], ) -> Result<Value, RqError>
async fn live_post( &self, path: &str, body: &Value, ) -> (RequestBuilder, SemaphorePermit<'_>)
async fn run_live_post( &self, path: &str, body: &Value, ) -> Result<Value, RqError>
async fn meet_get(&self, path: &str) -> (RequestBuilder, SemaphorePermit<'_>)
async fn run_meet_get(&self, path: &str) -> Result<Value, RqError>
async fn meet_post_bytes( &self, path: &str, body: &[u8], ) -> (RequestBuilder, SemaphorePermit<'_>)
async fn run_meet_post_bytes( &self, path: &str, body: &[u8], ) -> Result<Value, RqError>
async fn meet_post( &self, path: &str, body: &Value, ) -> (RequestBuilder, SemaphorePermit<'_>)
async fn run_meet_post( &self, path: &str, body: &Value, ) -> Result<Value, RqError>
Source§impl OAuthApiClient for NadeoClient
impl OAuthApiClient for NadeoClient
Source§async fn get_oauth_token(&self) -> Result<OAuthToken, String>
async fn get_oauth_token(&self) -> Result<OAuthToken, String>
For adding API requests, use
get_oauth_permit_and_token.async fn get_oauth_permit_and_token( &self, ) -> Result<(OAuthToken, SemaphorePermit<'_>), String>
Auto Trait Implementations§
impl !Freeze for NadeoClient
impl !RefUnwindSafe for NadeoClient
impl Send for NadeoClient
impl Sync for NadeoClient
impl Unpin for NadeoClient
impl !UnwindSafe for NadeoClient
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