Function mail_tm_rs::delete_account[][src]

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

Delete an account

Delete 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, update_token, token, delete_account, 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);
    //delete_account(&user, &account.id.unwrap()).await?;
    Ok(())
}