deep_causality/traits/contextuable/
datable_uncertain.rs

1/*
2 * SPDX-License-Identifier: MIT
3 * Copyright (c) "2025" . The DeepCausality Authors and Contributors. All Rights Reserved.
4 */
5use crate::Identifiable;
6use deep_causality_uncertain::{ProbabilisticType, Uncertain};
7
8/// Represents uncertain data entities in a context graph.
9///
10/// This trait marks nodes that carry domain-specific data
11/// relevant to inference, observation, or explanation. It extends
12/// [`Identifiable`] to ensure that each instance has a unique identity.
13///
14/// This trait is intentionally left minimal to allow full flexibility
15/// in how data is modeled. You may wrap sensor input, encoded strings,
16/// discrete values, or even external references.
17///
18pub trait UncertainDatable<T>: Identifiable
19where
20    T: ProbabilisticType,
21{
22    /// Returns the contained data.
23    ///
24    /// If `Self::Data` is `Copy`, this will typically return a copy. Otherwise, it may
25    /// return a clone or a new instance depending on the implementation.
26    fn get_data(&self) -> Uncertain<T>;
27
28    /// Sets or updates the contained data with a new value.
29    fn set_data(&mut self, value: Uncertain<T>);
30}