liblitho 0.2.0

cli tool to flash/clone the images to storage devices
Documentation
//! Unsupported OS privilege stubs.

use crate::platform::traits::{ElevationCapability, PrivilegeOps};

use super::UnsupportedPlatform;

impl PrivilegeOps for UnsupportedPlatform {
    fn elevation_method() -> &'static str {
        "unsupported"
    }

    fn is_elevated() -> bool {
        false
    }

    fn elevation_capability() -> ElevationCapability {
        ElevationCapability {
            ready: false,
            status_label: "elevation unsupported",
        }
    }

    fn validate_elevation_prerequisites() -> Result<(), String> {
        Err("Privilege elevation is not supported on this platform. \
             Run litho-tui with appropriate privileges."
            .into())
    }

    fn elevation_dialog_lines() -> [&'static str; 3] {
        [
            "Flash and clone operations require elevated privileges.",
            "Automatic elevation is not available on this platform.",
            "Restart litho-tui from a privileged shell to continue.",
        ]
    }

    fn relaunch_elevated(_mode: &str, _device: &str, _image: &str) -> Result<(), String> {
        Err("Privilege elevation is not supported on this platform.".into())
    }
}