icydb-schema 0.66.5

IcyDB — A type-safe, embedded ORM and schema system for the Internet Computer
Documentation
use crate::prelude::*;

///
/// Sanitizer
///

#[derive(Clone, Debug, Serialize)]
pub struct Sanitizer {
    def: Def,
}

impl Sanitizer {
    /// Creates a sanitizer node from definition metadata.
    #[must_use]
    pub const fn new(def: Def) -> Self {
        Self { def }
    }

    /// Returns the sanitizer definition metadata.
    #[must_use]
    pub const fn def(&self) -> &Def {
        &self.def
    }
}

impl MacroNode for Sanitizer {
    fn as_any(&self) -> &dyn std::any::Any {
        self
    }
}

impl ValidateNode for Sanitizer {}

impl VisitableNode for Sanitizer {
    fn route_key(&self) -> String {
        self.def().path()
    }

    fn drive<V: Visitor>(&self, v: &mut V) {
        self.def().accept(v);
    }
}