pub struct Def {
pub symbol: String,
pub lib: String,
pub is_: Vec<String>,
pub tag_on: Vec<String>,
pub of: Option<String>,
pub mandatory: bool,
pub doc: String,
pub tags: HDict,
}Expand description
A single Haystack 4 definition loaded from Trio.
Each def has a symbol (name), belongs to a library, and has an
inheritance chain via the is tag. Additional metadata such as
tagOn, of, mandatory, and doc describe how the def relates
to entity types and other defs.
Fields§
§symbol: StringDef name, e.g. "ahu" or "lib:phIoT".
lib: StringLibrary name, e.g. "phIoT".
is_: Vec<String>Supertype symbols from the is tag.
tag_on: Vec<String>Entity types this tag applies to (tagOn).
of: Option<String>Target type for refs/choices (of tag).
mandatory: boolWhether this tag is mandatory on entities.
doc: StringHuman-readable documentation string.
Full HDict of all meta tags on this def.
Implementations§
Source§impl Def
impl Def
Sourcepub fn kind(&self) -> DefKind
pub fn kind(&self) -> DefKind
Derive the def kind from its supertype chain.
Priority order:
"lib"in is_ ->DefKind::Lib"choice"in is_ ->DefKind::Choice"entity"in is_ ->DefKind::Entity"val"or"scalar"in is_ ->DefKind::Val"feature"in is_ ->DefKind::Feature"-"in symbol ->DefKind::Conjunct- default ->
DefKind::Marker
Trait Implementations§
impl Eq for Def
Auto Trait Implementations§
impl Freeze for Def
impl RefUnwindSafe for Def
impl Send for Def
impl Sync for Def
impl Unpin for Def
impl UnsafeUnpin for Def
impl UnwindSafe for Def
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.