use crate::prelude::*;
#[derive(Clone, Debug, Serialize)]
pub struct Validator {
def: Def,
}
impl Validator {
#[must_use]
pub const fn new(def: Def) -> Self {
Self { def }
}
#[must_use]
pub const fn def(&self) -> &Def {
&self.def
}
}
impl MacroNode for Validator {
fn as_any(&self) -> &dyn std::any::Any {
self
}
}
impl ValidateNode for Validator {}
impl VisitableNode for Validator {
fn route_key(&self) -> String {
self.def().path()
}
fn drive<V: Visitor>(&self, v: &mut V) {
self.def().accept(v);
}
}