feignhttp 0.6.1

Declarative HTTP client for rust
Documentation
use feignhttp::{ClientConfig, FeignClientBuilder, feign, get};

#[get(url = "http://site_dne.com")]
async fn connect_timeout() -> feignhttp::Result<String> {}

#[tokio::test]
#[should_panic]
async fn test_connect_timeout() {
    connect_timeout().await.unwrap();
}

#[get(url = "https://httpbin.org/delay/5", timeout = 3000)]
async fn timeout() -> feignhttp::Result<String> {}

#[tokio::test]
#[should_panic]
async fn test_timeout() {
    timeout().await.unwrap();
}

#[get(url = "https://httpbin.org/delay/3", timeout = "{time}")]
async fn dynamic_timeout(#[param] time: u16) -> feignhttp::Result<String> {}

#[tokio::test]
#[should_panic]
async fn test_dynamic_timeout1() {
    dynamic_timeout(1000).await.unwrap();
}

#[tokio::test]
#[ignore = "Unstable network and services"]
async fn test_dynamic_timeout2() {
    dynamic_timeout(8000).await.unwrap();
}

#[feign(url = "https://httpbin.org", timeout = 3000)]
pub trait RequestTimeout {
    #[get("/delay/5")]
    async fn timeout(&self) -> feignhttp::Result<String>;
}

#[tokio::test]
#[should_panic]
async fn test_timeout_from_trait() {
    let request = RequestTimeout::builder().build().unwrap();
    request.timeout().await.unwrap();
}

#[feign(url = "https://httpbin.org")]
pub trait Config {
    #[get("/delay/5")]
    async fn read_timeout(&self) -> feignhttp::Result<String>;
}

#[tokio::test]
#[should_panic]
async fn test_config() {
    let mut config = ClientConfig::default();
    config.read_timeout = Some(3000);
    let request = Config::builder().config(config).build().unwrap();
    request.read_timeout().await.unwrap();
}