Skip to main content

datex_core/traits/
datex_native_structural.rs

1use crate::values::{
2    core_values::native::DatexNative,
3    value::value_classification::ValueClassification,
4};
5
6/// Marker trait indicating that this value does not have an entity type.
7/// This guarantees that [DatexNative::entity_type] will always return None for this value.
8pub trait DatexNativeStructural: DatexNative {
9    /// Returns the DATEX [ValueClassification] of the native value.
10    /// This only checks for the presence of tag, since entity type resolution requires a cache.
11    fn classification_without_cache(&self) -> ValueClassification {
12        match self.tag() {
13            Some(tag) => ValueClassification::new_with_tag(tag),
14            None => ValueClassification::new_unclassified(),
15        }
16        // TODO: impl types?
17    }
18}