icydb_schema/node/
def.rs

1use crate::prelude::*;
2
3///
4/// Def
5///
6
7#[derive(CandidType, Clone, Debug, Serialize)]
8pub struct Def {
9    pub module_path: &'static str,
10    pub ident: &'static str,
11    pub comments: Option<&'static str>,
12}
13
14impl Def {
15    // path
16    // the path to the actual Type
17    // ie. design::game::Rarity
18    #[must_use]
19    pub fn path(&self) -> String {
20        format!("{}::{}", self.module_path, self.ident)
21    }
22}
23
24impl ValidateNode for Def {}
25
26impl VisitableNode for Def {}