MCPcopy Create free account
hub / github.com/MaterializeInc/materialize / children_mut

Method children_mut

src/expr/src/relation.rs:2287–2329  ·  view source on GitHub ↗

Iterates through mutable references to child expressions.

(&mut self)

Source from the content-addressed store, hash-verified

2285
2286 /// Iterates through mutable references to child expressions.
2287 pub fn children_mut(&mut self) -> impl DoubleEndedIterator<Item = &mut Self> {
2288 let mut first = None;
2289 let mut second = None;
2290 let mut rest = None;
2291 let mut last = None;
2292
2293 use MirRelationExpr::*;
2294 match self {
2295 Constant { .. } | Get { .. } => (),
2296 Let { value, body, .. } => {
2297 first = Some(&mut **value);
2298 second = Some(&mut **body);
2299 }
2300 LetRec { values, body, .. } => {
2301 rest = Some(values);
2302 last = Some(&mut **body);
2303 }
2304 Project { input, .. }
2305 | Map { input, .. }
2306 | FlatMap { input, .. }
2307 | Filter { input, .. }
2308 | Reduce { input, .. }
2309 | TopK { input, .. }
2310 | Negate { input }
2311 | Threshold { input }
2312 | ArrangeBy { input, .. } => {
2313 first = Some(&mut **input);
2314 }
2315 Join { inputs, .. } => {
2316 rest = Some(inputs);
2317 }
2318 Union { base, inputs } => {
2319 first = Some(&mut **base);
2320 rest = Some(inputs);
2321 }
2322 }
2323
2324 first
2325 .into_iter()
2326 .chain(second)
2327 .chain(rest.into_iter().flatten())
2328 .chain(last)
2329 }
2330
2331 /// Iterative pre-order visitor.
2332 pub fn visit_pre<'a, F: FnMut(&'a Self)>(&'a self, mut f: F) {

Callers 15

fix_typesFunction · 0.45
destroy_carefullyMethod · 0.45
make_nonrecursiveMethod · 0.45
visit_pre_mutMethod · 0.45
visit_mut_childrenMethod · 0.45
applyMethod · 0.45
actionMethod · 0.45
refresh_typesFunction · 0.45

Calls 2

into_iterMethod · 0.45
flattenMethod · 0.45

Tested by

no test coverage detected