mattermost_api_rust_driver/api/
users.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use super::{ApiClient, ApiError};
use reqwest::Method;
use serde_derive::Deserialize;

#[derive(Debug, Deserialize)]
pub struct UserMeResponse {
    pub id: u64,
    pub username: String,
    pub email: String,
}

impl ApiClient {
    pub async fn get_users_me(&self) -> Result<UserMeResponse, ApiError> {
        self.send_request(Method::GET, "/users/me", None::<()>)
            .await
    }
}