Datable

Trait Datable 

Source
pub trait Datable: Identifiable {
    type Data;

    // Required methods
    fn get_data(&self) -> Self::Data;
    fn set_data(&mut self, value: Self::Data);
}
Expand description

Represents data-bearing entities in a context graph.

This trait marks nodes that carry domain-specific data relevant to inference, observation, or explanation. It extends Identifiable to ensure that each instance has a unique identity.

This trait is intentionally left minimal to allow full flexibility in how data is modeled. You may wrap sensor input, encoded strings, discrete values, or even external references.

Required Associated Types§

Required Methods§

Source

fn get_data(&self) -> Self::Data

Returns the contained data.

If Self::Data is Copy, this will typically return a copy. Otherwise, it may return a clone or a new instance depending on the implementation.

Source

fn set_data(&mut self, value: Self::Data)

Sets or updates the contained data with a new value.

Implementors§

Source§

impl Datable for UncertainBooleanData

Implements the Datable trait for DataUncertainBool.

Source§

impl Datable for UncertainFloat64Data

Implements the Datable trait for UncertainF64.

Source§

impl<T> Datable for Data<T>
where T: Default + Copy + Clone + PartialEq,

Implements the Datable trait for Data<T>.

This allows Data<T> to be used in contexts where a generic data container is expected, providing methods to get and set the inner data payload.

Source§

type Data = T