| 964 | } |
| 965 | |
| 966 | pub(crate) trait StageData { |
| 967 | fn start(fuzzer: &mut Fuzzer) -> Result<Self, StageExit> |
| 968 | where |
| 969 | Self: Sized; |
| 970 | fn fuzz_one(&mut self, fuzzer: &mut Fuzzer) -> Option<VmExit>; |
| 971 | fn end(&mut self, _fuzzer: &mut Fuzzer) {} |
| 972 | fn after_check(&mut self, _fuzzer: &mut Fuzzer, _is_interesting: bool) {} |
| 973 | } |
| 974 | |
| 975 | impl<S: StageData> FuzzerStage for S { |
| 976 | fn run(fuzzer: &mut Fuzzer, stats: &mut monitor::LocalStats) -> anyhow::Result<StageExit> { |