nadeo_api_rs::live

Trait LiveApiClient

Source
pub trait LiveApiClient: NadeoApiClient {
    // Provided methods
    async fn get_monthly_campaign(
        &self,
        ty: MonthlyCampaignType,
        length: u32,
        offset: u32,
    ) -> Result<MonthlyCampaign_List, 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>> { ... }
    async fn get_map_leaderboard(
        &self,
        map_uid: &str,
        only_world: bool,
        length: u32,
        offset: u32,
    ) -> Result<MapGroupLeaderboard, Box<dyn Error>> { ... }
    async fn get_records_by_time(
        &self,
        uid_scores: &[(&str, i32)],
    ) -> Result<Vec<RecordsByTime>, Box<dyn Error>> { ... }
    async fn get_group_surround(
        &self,
        group_uid: &str,
        map_uid: &str,
        lower: i32,
        upper: i32,
        score: u32,
    ) -> Result<RecordsSurround, Box<dyn Error>> { ... }
    async fn get_pb_surround(
        &self,
        map_uid: &str,
        lower: i32,
        upper: i32,
        score: u32,
    ) -> Result<RecordsSurround, Box<dyn Error>> { ... }
    async fn get_map_info(
        &self,
        map_uid: &str,
    ) -> Result<MapInfo, Box<dyn Error>> { ... }
    async fn get_map_info_multiple(
        &self,
        map_uids: &[&str],
    ) -> Result<MapInfos, Box<dyn Error>> { ... }
}
Expand description

API calls for the Live API

Provided Methods§

Source

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>>

https://webservices.openplanet.dev/live/leaderboards/top

calls api/token/leaderboard/group/{groupUid}/map/{mapUid}/top

Source

async fn get_map_leaderboard( &self, map_uid: &str, only_world: bool, length: u32, offset: u32, ) -> Result<MapGroupLeaderboard, Box<dyn Error>>

Personal_Best LB

https://webservices.openplanet.dev/live/leaderboards/top

calls api/token/leaderboard/group/Personal_Best/map/{mapUid}/top

Source

async fn get_records_by_time( &self, uid_scores: &[(&str, i32)], ) -> Result<Vec<RecordsByTime>, Box<dyn Error>>

https://webservices.openplanet.dev/live/leaderboards/position

Note: different groups are supported by the API but not this method. Note for future: “When using a different groupUid, make sure you’re only referencing currently open leaderboards. Maps with closed leaderboards will not be included in the response.”“

calls api/token/leaderboard/group/map?scores[{mapUid}]={score}

Source

async fn get_group_surround( &self, group_uid: &str, map_uid: &str, lower: i32, upper: i32, score: u32, ) -> Result<RecordsSurround, Box<dyn Error>>

https://webservices.openplanet.dev/live/leaderboards/surround

calls api/token/leaderboard/group/{groupUid}/map/{mapUid}/surround/{lower}/{upper}?score={score}

Source

async fn get_pb_surround( &self, map_uid: &str, lower: i32, upper: i32, score: u32, ) -> Result<RecordsSurround, Box<dyn Error>>

Surround on the Personal_Best group

https://webservices.openplanet.dev/live/leaderboards/surround

calls api/token/leaderboard/group/Personal_Best/map/{mapUid}/surround/{lower}/{upper}?score={score}

Source

async fn get_map_info(&self, map_uid: &str) -> Result<MapInfo, Box<dyn Error>>

Source

async fn get_map_info_multiple( &self, map_uids: &[&str], ) -> Result<MapInfos, Box<dyn Error>>

https://webservices.openplanet.dev/live/maps/info-multiple

calls api/token/map/get-multiple?mapUidList={mapUidList}

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§