pub struct IndependentConsumerEngine { /* private fields */ }Expand description
Minimal independent PlanEngine implementation used for the Phase 3
interoperability proof example. This is intentionally narrow and only
supports the read operators exercised by the checked-in proof corpus subset.
Implementations§
Source§impl IndependentConsumerEngine
impl IndependentConsumerEngine
Sourcepub fn new(graph: Graph) -> Self
pub fn new(graph: Graph) -> Self
Examples found in repository?
examples/independent_consumer_proof.rs (line 47)
40fn main() -> Result<(), String> {
41 let case_paths = proof_case_paths();
42 let cases = proof_cases();
43
44 let mut reports = Vec::with_capacity(cases.len());
45 let mut passed = 0usize;
46 for case in cases {
47 let mut engine = IndependentConsumerEngine::new(proof_fixture_graph());
48 let outcome = engine
49 .execute_plan(&case.plan)
50 .map_err(|err| err.to_string());
51 let assertion = match outcome {
52 Ok(result) if result.rows == case.expected_rows => Ok(()),
53 Ok(result) => Err(format!(
54 "row mismatch: expected {:?}, got {:?}",
55 case.expected_rows, result.rows
56 )),
57 Err(err) => Err(err),
58 };
59 if assertion.is_ok() {
60 passed += 1;
61 }
62 reports.push(IndependentConsumerProofCase {
63 case: case.name,
64 passed: assertion.is_ok(),
65 error: assertion.err(),
66 });
67 }
68
69 let report = IndependentConsumerProofReport {
70 proof_id: "plexus-independent-consumer-proof-v1".to_string(),
71 consumer: "independent-consumer-example".to_string(),
72 implementation: "independent PlanEngine implementation with a private flat graph store"
73 .to_string(),
74 supported_subset: SupportedSubset {
75 ops: vec![
76 "ScanNodes",
77 "Expand",
78 "OptionalExpand",
79 "Filter",
80 "Project",
81 "Sort",
82 "Return",
83 ],
84 exprs: vec![
85 "ColRef",
86 "PropAccess",
87 "IntLiteral",
88 "FloatLiteral",
89 "BoolLiteral",
90 "StringLiteral",
91 "NullLiteral",
92 "Cmp",
93 ],
94 notes: vec![
95 "This proof intentionally covers a bounded core-read subset only.",
96 "The example does not reuse the reference engine execution path.",
97 "The checked-in JSON artifact is produced by running this example.",
98 ],
99 },
100 reference_contract: flagship_graph_rag_reference_contract(),
101 case_sources: case_paths
102 .iter()
103 .map(|path| path.display().to_string())
104 .collect(),
105 total: reports.len(),
106 passed,
107 failed: reports.len().saturating_sub(passed),
108 cases: reports,
109 };
110
111 println!(
112 "{}",
113 serde_json::to_string_pretty(&report).map_err(|err| err.to_string())?
114 );
115 Ok(())
116}Trait Implementations§
Source§impl Clone for IndependentConsumerEngine
impl Clone for IndependentConsumerEngine
Source§fn clone(&self) -> IndependentConsumerEngine
fn clone(&self) -> IndependentConsumerEngine
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for IndependentConsumerEngine
impl Debug for IndependentConsumerEngine
Source§impl PlanEngine for IndependentConsumerEngine
impl PlanEngine for IndependentConsumerEngine
type Error = ExecutionError
Source§fn execute_plan(&mut self, plan: &Plan) -> Result<QueryResult, Self::Error>
fn execute_plan(&mut self, plan: &Plan) -> Result<QueryResult, Self::Error>
Execute a deserialized plan.
Auto Trait Implementations§
impl Freeze for IndependentConsumerEngine
impl RefUnwindSafe for IndependentConsumerEngine
impl Send for IndependentConsumerEngine
impl Sync for IndependentConsumerEngine
impl Unpin for IndependentConsumerEngine
impl UnsafeUnpin for IndependentConsumerEngine
impl UnwindSafe for IndependentConsumerEngine
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