fauna-api 1.0.693

The Fauna SDK for Rust: accounts, Drive, groups, calendar, chats, payments, Parrot and live rooms.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use serde_json::json;

use crate::authentification::{Credentials, PartialProfile, Profile};
use crate::error::Result;
use crate::http::{client, ok};

pub async fn query(credentials: &Credentials, profile: &PartialProfile) -> Result<Vec<Profile>> {
    let response = client()
        .post(format!("{}/authentification/query", crate::get_url()))
        .header("Authorization", format!("Token {}", credentials.token))
        .json(&json!({ "email": profile.email, "displayName": profile.display_name }))
        .send()
        .await?;
    Ok(ok(response).await?.json().await?)
}