1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
use crate::meta::{MetaClient, Result};

pub struct InfoClient<'client> {
    client: &'client MetaClient,
}

impl<'client> InfoClient<'client> {
    pub fn new(client: &'client MetaClient) -> Self {
        Self { client }
    }

    pub async fn get(&self) -> Result<String> {
        let result: Result<serde_json::Value> = self.client.get("/meta/info", None::<&()>).await;

        match result {
            Ok(value) => Ok(value.to_string()),
            Err(e) => Err(e),
        }
    }
}