datex-core 0.0.13

The DATEX Core Rust implementation
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use crate::values::{
    core_values::native::DatexNative,
    value::value_classification::ValueClassification,
};

/// Marker trait indicating that this value does not have an entity type.
/// This guarantees that [DatexNative::entity_type] will always return None for this value.
pub trait DatexNativeStructural: DatexNative {
    /// Returns the DATEX [ValueClassification] of the native value.
    /// This only checks for the presence of tag, since entity type resolution requires a cache.
    fn classification_without_cache(&self) -> ValueClassification {
        match self.tag() {
            Some(tag) => ValueClassification::new_with_tag(tag),
            None => ValueClassification::new_unclassified(),
        }
        // TODO: impl types?
    }
}