MCPcopy Create free account
hub / github.com/comnik/declarative-dataflow / direction

Function direction

src/plan/hector.rs:140–166  ·  view source on GitHub ↗
(prefix: &P, extender_variables: (Var, Var))

Source from the content-addressed store, hash-verified

138}
139
140fn direction<P>(prefix: &P, extender_variables: (Var, Var)) -> Result<Direction, &'static str>
141where
142 P: AsBinding + std::fmt::Debug,
143{
144 match AsBinding::binds(prefix, extender_variables.0) {
145 None => match AsBinding::binds(prefix, extender_variables.1) {
146 None => {
147 error!(
148 "Neither extender variable {:?} bound by prefix {:?}.",
149 extender_variables, prefix
150 );
151 Err("Neither extender variable bound by prefix.")
152 }
153 Some(offset) => Ok(Direction::Reverse(offset)),
154 },
155 Some(offset) => {
156 match AsBinding::binds(prefix, extender_variables.1) {
157 Some(_) => Err("Both extender variables already bound by prefix."),
158 None => {
159 // Prefix binds the first extender variable, but not
160 // the second. Can use forward index.
161 Ok(Direction::Forward(offset))
162 }
163 }
164 }
165 }
166}
167
168/// Bindings can be in conflict with the source binding of a given
169/// delta pipeline. We need to identify them and handle them as

Callers 2

into_extenderMethod · 0.85
implementMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected