Function gitea_rust_sdk::user::emails::get_emails
source · [−]pub async fn get_emails(client: Client) -> Vec<Email>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A>where
A: Allocator,
Expand description
Get all registered emails of the currently logged in user
use gitea_rust_sdk::{client::Client, user::emails::get_emails, URL, TOKEN};
use assert_str::assert_str_eq;
use tokio;
#[tokio::main]
async fn main()
{
let client = Client::new(&URL, &TOKEN, "schorch/gitea_rust_sdk").unwrap();
let emails = get_emails(client).await;
assert_str_eq!(emails[0].email, "rene@schaar.priv.at");
assert!(emails[0].verified);
assert!(emails[0].primary);
}