refactor: create trait for writing response from interpreter

This commit is contained in:
Jindřich Moravec 2024-02-05 16:14:33 +01:00
parent b87ff160d2
commit b5405d7575
7 changed files with 118 additions and 80 deletions

View file

@ -1,6 +1,7 @@
use clap::Parser;
use std::net::{IpAddr, Ipv4Addr, SocketAddr};
use std::path::PathBuf;
use std::time::Duration;
const LOCAL_IPV4: IpAddr = IpAddr::V4(Ipv4Addr::LOCALHOST);
@ -34,7 +35,7 @@ impl Configuration {
}
#[inline]
pub fn get_throttle(&self) -> Option<u64> {
self.throttle
pub fn get_throttle(&self) -> Option<Duration> {
self.throttle.map(|d| Duration::from_millis(d))
}
}