use crate::prelude::*;
#[derive(CandidType, Clone, Debug, Serialize)]
pub struct Def {
module_path: &'static str,
ident: &'static str,
}
impl Def {
#[must_use]
pub const fn new(module_path: &'static str, ident: &'static str) -> Self {
Self { module_path, ident }
}
#[must_use]
pub const fn module_path(&self) -> &'static str {
self.module_path
}
#[must_use]
pub const fn ident(&self) -> &'static str {
self.ident
}
#[must_use]
pub fn path(&self) -> String {
format!("{}::{}", self.module_path(), self.ident())
}
}
impl ValidateNode for Def {}
impl VisitableNode for Def {}