/// Prints the current account IDs and metadata as reported by the supplied account manager.
Prints the current account IDs and metadata as reported by the supplied account manager.
Prints the current account IDs and metadata as reported by the supplied account manager .
async fn print_account_data(account_manager: &AccountManagerProxy) -> Result<(), Error> {
    let ids = account_manager.get_account_ids().await?;
    println!("{} account{} present:", ids.len(), if ids.len() == 1 { "" } else { "s" });
    for id in ids {
        let metadata_str = match account_manager.get_account_metadata(id).await? {
            Ok(AccountMetadata { name: Some(name), .. }) => format!("name:{}", name),
            Ok(AccountMetadata { name: None, .. }) => "<name not set>".to_string(),
            Err(_) => "<error getting metadata>".to_string(),
        };
        println!("  ID:{}  {}", id, metadata_str);
    }
    Ok(())
}
async fn print_account_data ( account_manager : & AccountManagerProxy ) -> Result < ( ) , Error > { let ids = account_manager . get_account_ids ( ) . await ? ; println ! ( " " ids len ( ) if ids len ( ) 1 { " " } else { " " } ) ; for id in ids { let metadata_str = match account_manager . get_account_metadata ( id ) . await ? { Ok ( AccountMetadata { name : Some ( name ) , .. } ) => format ! ( " " name ) , Ok ( AccountMetadata { name : None , .. } ) => " " . to_string ( ) , Err ( _ ) => " " . to_string ( ) , } ; println ! ( " " id metadata_str ) ; } Ok ( ( ) ) }
Prints the current account IDs and metadata as reported by the supplied account manager.
Prints the current account IDs and metadata as reported by the supplied account manager .
account_manager
&AccountManagerProxy