Returns the index of the only input referenced in the given expression.
(&self, expr: &impl Columns)
| 236 | |
| 237 | /// Returns the index of the only input referenced in the given expression. |
| 238 | pub fn single_input(&self, expr: &impl Columns) -> Option<usize> { |
| 239 | let mut inputs = self.lookup_inputs(expr); |
| 240 | if let Some(first_input) = inputs.next() { |
| 241 | if inputs.next().is_none() { |
| 242 | return Some(first_input); |
| 243 | } |
| 244 | } |
| 245 | None |
| 246 | } |
| 247 | |
| 248 | /// Returns whether the given expr refers to columns of only the `index`th input. |
| 249 | pub fn is_localized(&self, expr: &impl Columns, index: usize) -> bool { |
no test coverage detected