xreq_lib/
lib.rs

1mod diff;
2mod req;
3
4pub use diff::{DiffConfig, DiffContext, DiffResult, ResponseContext};
5pub use req::{RequestConfig, RequestContext};
6
7// re-exports
8pub use reqwest::Response;
9
10#[derive(Debug, Clone, Copy, PartialEq, Eq)]
11pub enum KeyValType {
12    /// if key has no any prefix, it is for query
13    Query,
14    /// if key starts with '#', it is for header
15    Header,
16    /// if key starts with '@', it is for body
17    Body,
18}
19
20impl Default for KeyValType {
21    fn default() -> Self {
22        KeyValType::Query
23    }
24}
25
26#[derive(Debug, Clone, PartialEq, Eq)]
27pub struct KeyVal {
28    pub kv_type: KeyValType,
29    pub key: String,
30    pub val: String,
31}
32
33impl KeyVal {
34    pub fn new(kv_type: KeyValType, key: impl Into<String>, val: impl Into<String>) -> Self {
35        Self {
36            kv_type,
37            key: key.into(),
38            val: val.into(),
39        }
40    }
41}