fauna-api 1.0.686

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
16
17
18
use serde_json::json;

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

pub async fn query(
    credentials: &Credentials,
    profile: &PartialProfile,
) -> Result<Vec<Credentials>> {
    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?)
}