alto_client/
utils.rs

1use crate::{Client, Error};
2
3fn healthy_path(base: String) -> String {
4    format!("{base}/health")
5}
6
7impl Client {
8    pub async fn health(&self) -> Result<(), Error> {
9        let result = self
10            .client
11            .get(healthy_path(self.uri.clone()))
12            .send()
13            .await
14            .map_err(Error::from)?;
15        if !result.status().is_success() {
16            return Err(Error::Failed(result.status()));
17        }
18        Ok(())
19    }
20}