mirror of
https://github.com/lexmount/moli.git
synced 2026-10-05 16:00:54 +00:00
Replace --cdp-screencast-fps with --screencast-interval. Accept positive integer milliseconds, retain the --layout requirement, and default to 1000 ms. Pass the interval through server configuration and multiply the Duration by everyNthFrame without converting through integer FPS. Update CLI help and English/Chinese docs. Cover parsing, defaults, rejected values and the removed flag, precise deadlines, and interval multiplication. Validation: - cargo fmt --all - cargo clippy --workspace --all-targets --all-features -- -D warnings - cargo nextest run --no-fail-fast
29 lines
724 B
Rust
29 lines
724 B
Rust
pub(crate) const DEFAULT_SCREENCAST_INTERVAL_MS: u32 = 1000;
|
|
|
|
/// Network and connection settings for the automation protocol server.
|
|
#[derive(Debug, Clone)]
|
|
pub struct ServerConfig {
|
|
pub host: String,
|
|
pub port: u16,
|
|
pub timeout_secs: u32,
|
|
/// Base screencast interval in milliseconds; must be positive.
|
|
pub screencast_interval_ms: u32,
|
|
}
|
|
|
|
impl ServerConfig {
|
|
pub fn bind_target(&self) -> (&str, u16) {
|
|
(&self.host, self.port)
|
|
}
|
|
}
|
|
|
|
impl Default for ServerConfig {
|
|
fn default() -> Self {
|
|
Self {
|
|
host: "127.0.0.1".to_owned(),
|
|
port: 9222,
|
|
timeout_secs: 10,
|
|
screencast_interval_ms: DEFAULT_SCREENCAST_INTERVAL_MS,
|
|
}
|
|
}
|
|
}
|