1use std::{net::IpAddr, time::Instant};
2
3use cidr::IpCidr;
4
5use crate::type_alias::HttpRequest;
6
7pub struct Condition {
8 pub ip_addr: Option<IpAddr>,
9 pub region: Option<Region>,
10 pub time: Instant,
11}
12
13pub struct Conditions {
14 pub ip_addr: Vec<IpAddr>,
15 pub region: Vec<Region>,
16 pub times: Vec<(Instant, Instant)>,
17}
18
19impl Condition {}
20
21pub trait ConditionExt {
22 fn condition(&self) -> Condition;
23}
24
25impl ConditionExt for HttpRequest {
26 fn condition(&self) -> Condition {
27 Condition {
28 ip_addr: None,
29 region: None,
30 time: Instant::now(),
31 }
32 }
33}
34
35pub enum Region {}