sf-rate-limiter 0.1.0

Request Rate Limiter. The project is a port of Symfony Rate Limiter.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use crate::{LocalDateTime, RateLimit};

#[derive(Debug)]
pub struct Reservation {
    /// Unix timestamp in seconds when this reservation should act
    pub(crate) time_to_act: LocalDateTime,
    pub(crate) rate_limit: RateLimit,
}

impl Reservation {
    pub fn get_time_to_act(&self) -> &LocalDateTime {
        &self.time_to_act
    }

    pub fn get_rate_limit(&self) -> &RateLimit {
        &self.rate_limit
    }
}