twine_http_store 0.1.3

Twine protocol rust library http store
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#![doc = include_str!("../README.md")]
pub use reqwest;
pub mod v1;
pub mod v2;
#[cfg(feature = "server")]
pub mod server;

/// Determine the version of a twine HTTP store
pub async fn determine_version(uri: &str) -> Option<u8> {
  let client = reqwest::Client::new();
  let res = client.head(uri).send().await.ok()?;
  let headers = res.headers();
  let version = headers.get("X-Spool-Version")?;
  version.to_str().ok()?.parse().ok()
}