pub struct NadeoClient {
pub user_agent: UserAgentDetails,
pub max_concurrent_requests: usize,
/* private fields */
}
Expand description
Main client for nadeo services
Fields§
§user_agent: UserAgentDetails
§max_concurrent_requests: usize
Implementations§
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, NadeoError>
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§async fn get_zone_tree(&self) -> Result<&ZoneTree, NadeoError>
async fn get_zone_tree(&self) -> Result<&ZoneTree, NadeoError>
Get the zone tree – cached!
Source§async fn get_user_zones<T: Into<String> + Clone>(
&self,
player_ids: &[T],
) -> Result<HashMap<String, PlayerZone>, NadeoError>
async fn get_user_zones<T: Into<String> + Clone>( &self, player_ids: &[T], ) -> Result<HashMap<String, PlayerZone>, NadeoError>
Get players’ zone details Read more
Source§impl LiveApiClient for NadeoClient
impl LiveApiClient for NadeoClient
Source§async fn push_rec_position_req(
&'static self,
map_uid: &str,
score: i64,
) -> Receiver<ScoreToPos>
async fn push_rec_position_req( &'static self, map_uid: &str, score: i64, ) -> Receiver<ScoreToPos>
Internal method supporting
get_lb_position_by_time_batched
Source§async fn get_monthly_campaign(
&self,
ty: MonthlyCampaignType,
length: u32,
offset: u32,
) -> Result<MonthlyCampaign_List, NadeoError>
async fn get_monthly_campaign( &self, ty: MonthlyCampaignType, length: u32, offset: u32, ) -> Result<MonthlyCampaign_List, NadeoError>
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, NadeoError>
async fn get_map_group_leaderboard( &self, group_uid: &str, map_uid: &str, only_world: bool, length: u32, offset: u32, ) -> Result<MapGroupLeaderboard, NadeoError>
Source§async fn get_map_leaderboard(
&self,
map_uid: &str,
only_world: bool,
length: u32,
offset: u32,
) -> Result<MapGroupLeaderboard, NadeoError>
async fn get_map_leaderboard( &self, map_uid: &str, only_world: bool, length: u32, offset: u32, ) -> Result<MapGroupLeaderboard, NadeoError>
Personal_Best LB Read more
Source§async fn get_lb_positions_by_time(
&self,
uid_scores: &[(&str, NonZero<u32>)],
) -> Result<Vec<RecordsByTime>, NadeoError>
async fn get_lb_positions_by_time( &self, uid_scores: &[(&str, NonZero<u32>)], ) -> Result<Vec<RecordsByTime>, NadeoError>
Source§async fn get_lb_positions_by_time_group(
&self,
uid_scores: &[(&str, NonZero<u32>)],
group_uid: &str,
) -> Result<Vec<RecordsByTime>, NadeoError>
async fn get_lb_positions_by_time_group( &self, uid_scores: &[(&str, NonZero<u32>)], group_uid: &str, ) -> Result<Vec<RecordsByTime>, NadeoError>
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, NadeoError>
async fn get_group_surround( &self, group_uid: &str, map_uid: &str, lower: i32, upper: i32, score: u32, only_world: bool, ) -> Result<RecordsSurround, NadeoError>
Source§async fn get_pb_surround(
&self,
map_uid: &str,
lower: i32,
upper: i32,
score: u32,
only_world: bool,
) -> Result<RecordsSurround, NadeoError>
async fn get_pb_surround( &self, map_uid: &str, lower: i32, upper: i32, score: u32, only_world: bool, ) -> Result<RecordsSurround, NadeoError>
Surround on the Personal_Best group Read more
Source§async fn get_map_info(
&self,
map_uid: &str,
) -> Result<Option<MapInfo>, NadeoError>
async fn get_map_info( &self, map_uid: &str, ) -> Result<Option<MapInfo>, NadeoError>
Source§async fn get_map_info_multiple(
&self,
map_uids: &[&str],
) -> Result<MapInfos, NadeoError>
async fn get_map_info_multiple( &self, map_uids: &[&str], ) -> Result<MapInfos, NadeoError>
Source§async fn get_club_activities(
&self,
club_id: i32,
length: u32,
offset: u32,
active: bool,
) -> Result<ClubActivityList, NadeoError>
async fn get_club_activities( &self, club_id: i32, length: u32, offset: u32, active: bool, ) -> Result<ClubActivityList, NadeoError>
Source§async fn get_club_info(&self, club_id: i32) -> Result<ClubInfo, NadeoError>
async fn get_club_info(&self, club_id: i32) -> Result<ClubInfo, NadeoError>
Source§async fn get_club_campaign_by_id(
&self,
club_id: i32,
campaign_id: i32,
) -> Result<ClubCampaignById, NadeoError>
async fn get_club_campaign_by_id( &self, club_id: i32, campaign_id: i32, ) -> Result<ClubCampaignById, NadeoError>
Source§async fn get_club_campaigns(
&self,
length: u32,
offset: u32,
name: Option<&str>,
) -> Result<ClubCampaignList, NadeoError>
async fn get_club_campaigns( &self, length: u32, offset: u32, name: Option<&str>, ) -> Result<ClubCampaignList, NadeoError>
Source§async fn get_club_rooms(
&self,
length: u32,
offset: u32,
name: Option<&str>,
) -> Result<ClubRoomList, NadeoError>
async fn get_club_rooms( &self, length: u32, offset: u32, name: Option<&str>, ) -> Result<ClubRoomList, NadeoError>
Source§async fn get_club_room_by_id(
&self,
club_id: i32,
activity_id: i32,
) -> Result<ClubRoom, NadeoError>
async fn get_club_room_by_id( &self, club_id: i32, activity_id: i32, ) -> Result<ClubRoom, NadeoError>
async fn edit_club_room_by_id( &self, club_id: i32, activity_id: i32, body: &ClubRoom_Room_ForEdit, ) -> Result<ClubRoom, NadeoError>
async fn create_club_room( &self, club_id: i32, body: &ClubRoom_Room_ForEdit, ) -> Result<ClubRoom, NadeoError>
Source§async fn get_club_activity_list(
&self,
club_id: i32,
length: u32,
offset: u32,
active: Option<bool>,
) -> Result<ActivityList, NadeoError>
async fn get_club_activity_list( &self, club_id: i32, length: u32, offset: u32, active: Option<bool>, ) -> Result<ActivityList, NadeoError>
async fn edit_club_activity( &self, club_id: i32, activity_id: i32, public: Option<bool>, active: Option<bool>, ) -> Result<Value, NadeoError>
Source§async fn get_clubs(
&self,
length: u32,
offset: u32,
name: Option<&str>,
) -> Result<ClubList, NadeoError>
async fn get_clubs( &self, length: u32, offset: u32, name: Option<&str>, ) -> Result<ClubList, NadeoError>
async fn get_clubs_mine( &self, length: u32, offset: u32, ) -> Result<ClubList, NadeoError>
Source§impl MeetApiClient for NadeoClient
impl MeetApiClient for NadeoClient
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 Get the auth token for the given audience (used to construct the header)
Source§async fn aget_auth_token(&self, audience: NadeoAudience) -> String
async fn aget_auth_token(&self, audience: NadeoAudience) -> String
Get the auth token for the given audience (used to construct the header)
async fn get_client(&self) -> &Client
async fn rate_limit(&self) -> SemaphorePermit<'_>
async fn get_file_size(&self, url: &str) -> Result<u64, RqError>
fn get_auth_header( &self, audience: NadeoAudience, ) -> Result<String, TryLockError>
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