lssa/networking/src/rate_limiter.rs
2024-10-04 06:16:13 +03:00

17 lines
376 B
Rust

use std::collections::HashMap;
use crate::network_protocol::MessageKind;
#[derive(Debug)]
/// Object responsible to manage the rate limits of all network messages
/// for a single connection/peer.
pub struct RateLimiter {
pub limits: HashMap<MessageKind, u64>,
}
impl RateLimiter {
pub fn is_allowed(&self, _message: MessageKind) -> bool {
todo!();
}
}