Skip to main content

get_all_titles/
get_all_titles.rs

1mod utils;
2
3use psn_rs::PSNApiResult;
4
5#[tokio::main]
6async fn main() -> PSNApiResult<()> {
7    let mut psn_client = utils::build_client()?;
8
9    psn_client.authenticate().await?;
10
11    let account_id = psn_client.get_own_account_id().await?;
12
13    let trophy_titles = psn_client.get_all_trophies_titles(&account_id).await?;
14
15    for trophy_title in trophy_titles {
16        println!(
17            "ID: {} - Name: {} - Platform: {} - progress: {}",
18            trophy_title.np_communication_id,
19            trophy_title.trophy_title_name,
20            trophy_title.trophy_title_platform,
21            trophy_title.progress
22        );
23    }
24
25    Ok(())
26}