1use crate::prelude::*;
2
3#[derive(CandidType, Clone, Debug, Serialize)]
8pub struct Def {
9 module_path: &'static str,
10 ident: &'static str,
11}
12
13impl Def {
14 #[must_use]
16 pub const fn new(module_path: &'static str, ident: &'static str) -> Self {
17 Self { module_path, ident }
18 }
19
20 #[must_use]
22 pub const fn module_path(&self) -> &'static str {
23 self.module_path
24 }
25
26 #[must_use]
28 pub const fn ident(&self) -> &'static str {
29 self.ident
30 }
31
32 #[must_use]
36 pub fn path(&self) -> String {
37 format!("{}::{}", self.module_path(), self.ident())
38 }
39}
40
41impl ValidateNode for Def {}
42
43impl VisitableNode for Def {}