1use std::fmt;
2use std::path::{Path, PathBuf};
3
4#[derive(Clone, Copy, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
5pub enum Level {
6 Info,
7 Warn,
8 Error,
9}
10
11#[derive(Clone, Debug, PartialEq, Eq)]
12pub struct Notice {
13 pub level: Level,
14 pub text: String,
15}
16
17impl fmt::Display for Notice {
18 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
19 f.write_str(&self.text)
20 }
21}
22
23pub trait Reload {
24 fn files(&self) -> Vec<PathBuf>;
25
26 fn changed(&mut self, file: &Path);
27
28 fn notices(&mut self) -> Vec<Notice>;
29}