switchyard/api/
overrides.rs

1//! Per-instance simulation overrides used for test-only or controlled scenarios.
2
3/// Overrides for simulation in tests and controlled environments.
4#[derive(Clone, Debug, Default, Copy)]
5pub struct Overrides {
6    /// Force EXDEV behavior when performing atomic rename of symlinks.
7    /// `Some(true)` simulates a cross-filesystem rename error to exercise degraded fallback paths.
8    pub force_exdev: Option<bool>,
9    /// Force rescue verification to succeed regardless of actual PATH state.
10    pub force_rescue_ok: Option<bool>,
11}
12
13impl Overrides {
14    #[must_use]
15    /// Construct an overrides struct with `force_exdev` set.
16    pub fn exdev(v: bool) -> Self {
17        Self {
18            force_exdev: Some(v),
19            ..Default::default()
20        }
21    }
22    #[must_use]
23    /// Construct an overrides struct with `force_rescue_ok` set.
24    pub fn rescue_ok(v: bool) -> Self {
25        Self {
26            force_rescue_ok: Some(v),
27            ..Default::default()
28        }
29    }
30}