Function mail_tm_rs::get_account[][src]

pub async fn get_account(user: &User, id: &str) -> Result<Account, Error>
Expand description

Retrieve an account

Retrieve an account by its id. This uses the User::email_token field to build the auth header.

Example

use mail_tm_rs::user::User;
use mail_tm_rs::{create_account, get_account, update_token, token, domains};

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    //let user = User::default().with_domain(&domains().await?.any().domain);
    //let account = create_account(&user).await?;
    //let user = update_token(&user, &token(&user).await?.token);
    //let account = get_account(&user, &account.id.unwrap()).await?;
    Ok(())
}