Merge branch 'problame/benchmarking/pr/mgmt-api-client' into problame/benchmarking/pr/page_service_api_client

This commit is contained in:
Christian Schwarz
2023-12-13 17:13:28 +01:00
committed by GitHub
3 changed files with 6 additions and 4 deletions

1
Cargo.lock generated
View File

@@ -3162,6 +3162,7 @@ dependencies = [
"enum-map",
"hex",
"postgres_ffi",
"rand 0.8.5",
"serde",
"serde_json",
"serde_with",

View File

@@ -15,6 +15,7 @@ byteorder.workspace = true
utils.workspace = true
postgres_ffi.workspace = true
enum-map.workspace = true
rand.workspace = true
strum.workspace = true
strum_macros.workspace = true
hex.workspace = true

View File

@@ -25,7 +25,7 @@ impl Client {
anyhow::bail!("status error");
}
let body = hyper::body::to_bytes(resp).await?;
Ok(serde_json::from_slice(&body)?)
serde_json::from_slice(&body).context("deserialize")
}
pub async fn list_timelines(
@@ -41,7 +41,7 @@ impl Client {
anyhow::bail!("status error");
}
let body = hyper::body::to_bytes(resp).await?;
Ok(serde_json::from_slice(&body)?)
serde_json::from_slice(&body).context("deserialize")
}
pub async fn timeline_info(
@@ -58,7 +58,7 @@ impl Client {
anyhow::bail!("status error");
}
let body = hyper::body::to_bytes(resp).await?;
Ok(serde_json::from_slice(&body)?)
serde_json::from_slice(&body).context("deserialize")
}
pub async fn keyspace(
@@ -75,7 +75,7 @@ impl Client {
anyhow::bail!("status error");
}
let body = hyper::body::to_bytes(resp).await?;
Ok(serde_json::from_slice(&body).context("deserialize")?)
serde_json::from_slice(&body).context("deserialize")
}
async fn get(&self, uri: Uri) -> hyper::Result<hyper::Response<hyper::Body>> {