Skip to main content

mur_common/
hooks_config.rs

1use serde::{Deserialize, Serialize};
2
3fn default_true() -> bool {
4    true
5}
6
7#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
8pub struct HooksConfig {
9    /// Whether the outbox `LedgerHook` runs. Default: true.
10    #[serde(default = "default_true")]
11    pub ledger: bool,
12
13    /// Whether `CompanionVoiceHook` runs.
14    /// `None` = auto-wire from `profile.companion.enabled`.
15    #[serde(default, skip_serializing_if = "Option::is_none")]
16    pub companion_voice: Option<bool>,
17
18    /// Whether `VoiceInputHook` runs.
19    /// `None` = auto-wire from `profile.voice.enabled`.
20    #[serde(default, skip_serializing_if = "Option::is_none")]
21    pub voice_input: Option<bool>,
22
23    /// Whether `TrashGuard` runs. Default: true.
24    #[serde(default = "default_true")]
25    pub trash_guard: bool,
26}
27
28impl Default for HooksConfig {
29    fn default() -> Self {
30        Self {
31            ledger: true,
32            companion_voice: None,
33            voice_input: None,
34            trash_guard: true,
35        }
36    }
37}