fire_http_api/request.rs
1use crate::error::ApiError;
2
3pub use fire::header::Method;
4
5use serde::{de::DeserializeOwned, Serialize};
6
7/// Basic request definition.
8///
9/// The request will be serialized and deserialized
10/// via Json to ease updating structures without breaking backwards
11/// compatibility.
12pub trait Request: Serialize + DeserializeOwned {
13 type Response: Serialize + DeserializeOwned;
14 type Error: ApiError;
15
16 const PATH: &'static str;
17 const METHOD: Method;
18 const SIZE_LIMIT: usize = 4096;
19 const TIMEOUT: usize = 60;
20 const HEADERS: &'static [&'static str] = &[];
21}