binfire_lib/
lib.rs

1//! This library provides the Runner interface to run binfire
2
3#![forbid(unsafe_code)]
4#![deny(clippy::cargo)]
5#![deny(clippy::doc_markdown)]
6#![deny(warnings)]
7
8use thiserror::Error;
9
10//mod avail;
11
12#[derive(Error, Debug)]
13pub enum RunError {}
14
15/// binfire runner Options req.
16pub trait RunnerOpts {
17    fn flag(&self, _: SubCommand) -> bool;
18}
19
20#[derive(Debug, Eq, PartialEq, Clone)]
21pub enum SubCommand {
22    Available,
23    Default,
24    Add,
25}
26
27pub struct Runner<C> {
28    pub binfire_command: C,
29}
30
31impl<C: RunnerOpts> Runner<C> {
32    pub fn blocking(binfire_opts: &C) -> Result<(), RunError> {
33        dbg!(binfire_opts.flag(SubCommand::Available));
34        Ok(())
35    }
36}
37
38/* whatever
39#[cfg(test)]
40mod tests {
41    use super::*;
42
43}
44 */