pub trait HasDataPoint {
// Required methods
fn data_point(&self) -> &DataPoint;
fn data_point_mut(&mut self) -> &mut DataPoint;
// Provided method
fn for_each_child_mut(
&mut self,
_visit: &mut dyn FnMut(&mut dyn HasDataPoint),
) { ... }
}Expand description
Read / write access to the embedded DataPoint of a typed container,
plus a hook to recurse into nested DataPoint-bearing children.
This trait is the Rust analogue of Python’s reflective
model_fields walk. Implementations are added crate-by-crate
(typically here in cognee-models); types not implementing the
trait are silently passed through by cognee_core::provenance::stamp_tree.
Required Methods§
Sourcefn data_point(&self) -> &DataPoint
fn data_point(&self) -> &DataPoint
Borrow the embedded DataPoint of this container.
Sourcefn data_point_mut(&mut self) -> &mut DataPoint
fn data_point_mut(&mut self) -> &mut DataPoint
Mutably borrow the embedded DataPoint of this container.
Provided Methods§
Sourcefn for_each_child_mut(&mut self, _visit: &mut dyn FnMut(&mut dyn HasDataPoint))
fn for_each_child_mut(&mut self, _visit: &mut dyn FnMut(&mut dyn HasDataPoint))
Visit every owned child that itself implements HasDataPoint.
Default: no children. Override on container types whose fields
own (rather than reference by Uuid) another HasDataPoint.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".