pub struct Data<T>{ /* private fields */ }Expand description
A generic container for a piece of data, associated with a unique identifier.
Data<T> is a fundamental building block for representing discrete pieces of
information within a larger system, such as a context or a causal graph. It
wraps a data payload of type T and pairs it with a u64 ID, allowing the
data to be uniquely identified and referenced.
The struct derives Clone, so a Data<T> duplicates whenever its payload does. The trait
bounds on T keep the payload constructible, duplicable, and comparable.
§Type Parameters
T: The type of the data payload. It must be a comparable type satisfying theDefault + Clone + PartialEqbounds.Copyis NOT required: it is asked for only by theAdjustableimpl, becauseArrayGridis backed by fixed-size arrays. AData<Vec<f64>>is therefore a valid context node.
Implementations§
Trait Implementations§
Source§impl<T> Adjustable<T> for Data<T>
impl<T> Adjustable<T> for Data<T>
Source§fn update<const WIDTH: usize, const HEIGHT: usize, const DEPTH: usize, const TIME: usize>(
&mut self,
array_grid: &ArrayGrid<T, WIDTH, HEIGHT, DEPTH, TIME>,
) -> Result<(), UpdateError>
fn update<const WIDTH: usize, const HEIGHT: usize, const DEPTH: usize, const TIME: usize>( &mut self, array_grid: &ArrayGrid<T, WIDTH, HEIGHT, DEPTH, TIME>, ) -> Result<(), UpdateError>
Source§fn adjust<const WIDTH: usize, const HEIGHT: usize, const DEPTH: usize, const TIME: usize>(
&mut self,
array_grid: &ArrayGrid<T, WIDTH, HEIGHT, DEPTH, TIME>,
) -> Result<(), AdjustmentError>
fn adjust<const WIDTH: usize, const HEIGHT: usize, const DEPTH: usize, const TIME: usize>( &mut self, array_grid: &ArrayGrid<T, WIDTH, HEIGHT, DEPTH, TIME>, ) -> Result<(), AdjustmentError>
Source§impl<T> Datable for Data<T>
Implements the Datable trait for Data<T>.
impl<T> Datable for Data<T>
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§impl<T> Identifiable for Data<T>
impl<T> Identifiable for Data<T>
Source§fn id(&self) -> ContextoidId
fn id(&self) -> ContextoidId
Source§impl<T: Storable + Default + Clone + PartialEq> Recordable<DataRecord> for Data<T>
Every storable payload makes its data node recordable. This is the one place a payload’s
Storable meets the node’s Recordable.
impl<T: Storable + Default + Clone + PartialEq> Recordable<DataRecord> for Data<T>
Every storable payload makes its data node recordable. This is the one place a payload’s
Storable meets the node’s Recordable.