skim_run/
lib.rs

1#![warn(clippy::all)]
2#![warn(clippy::pedantic)]
3
4use anyhow::Result;
5use std::sync::Arc;
6
7use skim::{SkimItem, SkimOutput};
8
9#[cfg(feature = "apps")]
10pub mod apps;
11#[cfg(feature = "calc")]
12pub mod calc;
13pub mod cli;
14#[cfg(feature = "hyprland")]
15pub mod hyprctl_clients;
16#[cfg(feature = "hyprland")]
17pub mod hyprctl_hide;
18#[cfg(feature = "paru")]
19pub mod paru;
20#[cfg(feature = "systemd")]
21pub mod systemd_services;
22pub use cli::*;
23
24pub trait SkimRun {
25    //! Init the runner
26    //! Will return false if we should stop here, or true if the skim instance should be started
27    fn init(&self, args: &Mode) -> bool {
28        let _ = args;
29        true
30    }
31
32    /// Get Items
33    fn get(&self) -> Vec<Arc<dyn SkimItem>> {
34        Vec::new()
35    }
36
37    /// Set `SkimOptions`
38    fn set_options(&self, opts: &mut skim::SkimOptions) {
39        let _ = opts;
40    }
41
42    /// Run on the result from skim
43    ///
44    /// # Errors
45    /// Returns an error if the underlying runner fails.
46    fn run(&self, output: &SkimOutput) -> Result<()> {
47        let _ = output;
48        Ok(())
49    }
50}