cpumap 0.2.1

GUI/TUI to view and edit CPU affinities of processes and threads on Linux
#[cfg(feature = "gui")]
use crate::eguifrontend::EguiFrontend;
#[cfg(feature = "tui")]
use crate::ratatuifrontend::RatatuiFrontend;

#[derive(Debug)]
pub enum UIFrontendType{
    // #[cfg(feature = "gui")]
    Egui,
    // #[cfg(feature = "tui")]
    Ratatui
}

/// All UI frontend implementations.
pub enum UIFrontend {
    #[cfg(feature = "gui")]
    Egui(EguiFrontend),
    #[cfg(feature = "tui")]
    Ratatui(RatatuiFrontend)
}

impl UIFrontend {
    #[cfg(feature = "gui")]
    /// Construct an egui based frontend.
    pub fn egui() -> UIFrontend {
        UIFrontend::Egui(EguiFrontend::new(/* cache */))
    }

    #[cfg(feature = "tui")]
    /// Construct a ratatui based frontend.
    pub fn ratatui() -> UIFrontend {
        UIFrontend::Ratatui(RatatuiFrontend::new())
    }
}