zsui 0.3.0-alpha.2

Rust-first feature-gated native UI framework for Win32, AppKit, and Linux.
Documentation
use crate::core::Command;
use serde::{Deserialize, Serialize};

#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub struct HotkeySpec {
    pub accelerator: String,
    pub command: Command,
    pub enabled: bool,
}

impl HotkeySpec {
    pub fn new(accelerator: impl Into<String>, command: Command) -> Self {
        Self {
            accelerator: accelerator.into(),
            command,
            enabled: true,
        }
    }

    pub fn enabled(mut self, enabled: bool) -> Self {
        self.enabled = enabled;
        self
    }
}