skip_if/
lib.rs

1mod strategies;
2pub use strategies::*;
3
4use std::path::Path;
5
6pub use skip_if_macros::skip_if;
7
8pub trait Strategy<O> {
9    type E: std::fmt::Debug;
10    /// Should we skip generating the `output`?
11    /// This can take into account the hash of the arguments and the code, provided as arguments.
12    fn skip(&self, output: &Path, args_hash: u64, code_hash: u64) -> bool;
13    /// When the output is not skipped, this is called after processing, right before returning.
14    fn callback(
15        &self,
16        _fn_output: &O,
17        _output: &Path,
18        _args_hash: u64,
19        _code_hash: u64,
20    ) -> Result<(), Self::E> {
21        Ok(())
22    }
23}