1use crate::error::Error;
6use crate::types::TestResult;
7
8pub trait OutputHandler: Send + Sync {
13 fn handle_result(&self, result: &TestResult) -> Result<(), Error>;
15
16 fn handle_error(&self, error: &Error) -> Result<(), Error>;
18}
19
20pub struct DefaultOutputHandler {
22 _format: crate::config::Format,
23 _bytes_mode: bool,
24}
25
26impl DefaultOutputHandler {
27 pub fn new(format: crate::config::Format, bytes_mode: bool) -> Self {
28 Self {
29 _format: format,
30 _bytes_mode: bytes_mode,
31 }
32 }
33}
34
35impl OutputHandler for DefaultOutputHandler {
36 fn handle_result(&self, _result: &TestResult) -> Result<(), Error> {
37 Ok(())
40 }
41
42 fn handle_error(&self, error: &Error) -> Result<(), Error> {
43 eprintln!("Error: {}", error);
44 Ok(())
45 }
46}