Function valorant_api::get_store_front_v2

source ·
pub async fn get_store_front_v2<T: HttpClient>(
    credentials_manager: &CredentialsManager,
    http_client: &T,
    region: Region,
    puuid: Uuid
) -> Result<StoreFrontV2, RequestError>
Expand description

Get the store front of a player

§Arguments

  • credentials_manager - The credentials manager
  • region - The region of the leaderboard
  • puuid - The puuid of the player

§Errors

RequestError - If the request failed

§Example

let puuid = Uuid::parse_str("34093c29-4306-43de-452f-3f944bde22be").expect("Invalid UUID");
let region = Region::EU;
let result = valorant_api::get_store_front_v1(credentials_manager, &http_client, region, puuid).await;
println!("Result: {:#?}", result);
Examples found in repository?
examples/store_front.rs (line 17)
8
9
10
11
12
13
14
15
16
17
18
19
20
async fn main() {
    let http_client = get_http_client().expect("Error while creating http client");
    let credentials_manager = get_credentials_manager(&http_client)
        .await
        .expect("Error while getting credentials manager");

    let puuid = Uuid::parse_str("f61351cc-aaf8-5b7d-a6bf-e2fe1caa2374").expect("Invalid UUID");
    let region = Region::EU;
    let result =
        valorant_api::get_store_front_v2(&credentials_manager, &http_client, region, puuid).await;
    println!("Result: {:#?}", result);
    assert!(result.is_ok());
}