pub struct CurationEngine { /* private fields */ }Expand description
Core engine that validates and persists DecisionRecords into the
Dolt‑backed graph.
§Why
Centralising curation logic ensures a single place for validation and storage semantics, keeping the rest of the codebase agnostic of the graph implementation details.
Implementations§
Source§impl CurationEngine
impl CurationEngine
Sourcepub fn new(graph: DoltGraph) -> Self
pub fn new(graph: DoltGraph) -> Self
Creates a new CurationEngine bound to the supplied DoltGraph.
The engine holds a reference to the graph for the lifetime of the instance; callers are responsible for providing a correctly initialised graph.
Sourcepub fn curate_decision(&self, dr: DecisionRecord) -> Result<(), SlurpError>
pub fn curate_decision(&self, dr: DecisionRecord) -> Result<(), SlurpError>
Validates the citations in dr and persists the decision into the
graph.
The method performs three steps:
- Citation validation – each citation string is parsed into a
UCXLAddress. Invalid citations produce aValidationError. - Table assurance – attempts to create the
curated_decisionstable if it does not already exist. Errors are ignored because the table may already be present. - Insertion & commit – the decision is serialised to JSON and inserted as a node, then the graph transaction is committed.
§Errors
Propagates any GraphError, serde_json::Error, or custom
validation failures.
Auto Trait Implementations§
impl Freeze for CurationEngine
impl RefUnwindSafe for CurationEngine
impl Send for CurationEngine
impl Sync for CurationEngine
impl Unpin for CurationEngine
impl UnwindSafe for CurationEngine
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more