MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / dispatch

Function dispatch

nodedb-physical/src/visitor.rs:49–68  ·  view source on GitHub ↗

Dispatch `plan` to the matching method on `visitor`. Adding a [`PhysicalPlan`] variant without a corresponding arm is a compile error.

(
    visitor: &mut V,
    plan: &PhysicalPlan,
)

Source from the content-addressed store, hash-verified

47/// Adding a [`PhysicalPlan`] variant without a corresponding arm is a
48/// compile error.
49pub fn dispatch<V: PhysicalTaskVisitor>(
50 visitor: &mut V,
51 plan: &PhysicalPlan,
52) -> Result<V::Output, V::Error> {
53 match plan {
54 PhysicalPlan::Vector(op) => visitor.vector(op),
55 PhysicalPlan::Graph(op) => visitor.graph(op),
56 PhysicalPlan::Document(op) => visitor.document(op),
57 PhysicalPlan::Kv(op) => visitor.kv(op),
58 PhysicalPlan::Text(op) => visitor.text(op),
59 PhysicalPlan::Columnar(op) => visitor.columnar(op),
60 PhysicalPlan::Timeseries(op) => visitor.timeseries(op),
61 PhysicalPlan::Spatial(op) => visitor.spatial(op),
62 PhysicalPlan::Crdt(op) => visitor.crdt(op),
63 PhysicalPlan::Query(op) => visitor.query(op),
64 PhysicalPlan::Meta(op) => visitor.meta(op),
65 PhysicalPlan::Array(op) => visitor.array(op),
66 PhysicalPlan::ClusterArray(op) => visitor.cluster_array(op),
67 }
68}

Callers 3

ddl_okFunction · 0.50
ddl_errFunction · 0.50
try_ddlFunction · 0.50

Calls 13

graphMethod · 0.80
textMethod · 0.80
crdtMethod · 0.80
cluster_arrayMethod · 0.80
vectorMethod · 0.45
documentMethod · 0.45
kvMethod · 0.45
columnarMethod · 0.45
timeseriesMethod · 0.45
spatialMethod · 0.45
queryMethod · 0.45
metaMethod · 0.45

Tested by

no test coverage detected