use std::path::Path;
use xuanji::{BoundDecl, Observer, Outcome};
use crate::{Constitution, check, observation_bounds};
#[derive(Debug, Clone)]
pub struct StaticObserver {
constitution: Constitution,
}
impl StaticObserver {
pub fn new(constitution: Constitution) -> Self {
Self { constitution }
}
}
impl Observer for StaticObserver {
fn observe(&self, manifest_path: &Path) -> Outcome {
check(&self.constitution, manifest_path)
}
fn bounds(&self) -> Vec<BoundDecl> {
observation_bounds()
}
}