Transforms the node using `f_down` while traversing the tree top-down (pre-order), and using `f_up` while traversing the tree bottom-up (post-order). The method behaves the same as calling [`Self::transform_down`] followed by [`Self::transform_up`] on the same node. Use this method if you want to start the `f_up` process right where `f_down` jumps. This can make the whole process faster by reduci
(
self,
mut f_down: FD,
mut f_up: FU,
)
| 364 | /// +---+ |
| 365 | /// ``` |
| 366 | fn transform_down_up< |
| 367 | FD: FnMut(Self) -> Result<Transformed<Self>>, |
| 368 | FU: FnMut(Self) -> Result<Transformed<Self>>, |
| 369 | >( |
| 370 | self, |
| 371 | mut f_down: FD, |
| 372 | mut f_up: FU, |
| 373 | ) -> Result<Transformed<Self>> { |
| 374 | #[cfg_attr(feature = "recursive_protection", recursive::recursive)] |
| 375 | fn transform_down_up_impl< |
| 376 | N: TreeNode, |
| 377 | FD: FnMut(N) -> Result<Transformed<N>>, |
| 378 | FU: FnMut(N) -> Result<Transformed<N>>, |
| 379 | >( |
| 380 | node: N, |
| 381 | f_down: &mut FD, |
| 382 | f_up: &mut FU, |
| 383 | ) -> Result<Transformed<N>> { |
| 384 | handle_transform_recursion!( |
| 385 | f_down(node), |
| 386 | |c| transform_down_up_impl(c, f_down, f_up), |
| 387 | f_up |
| 388 | ) |
| 389 | } |
| 390 | |
| 391 | transform_down_up_impl(self, &mut f_down, &mut f_up) |
| 392 | } |
| 393 | |
| 394 | /// Returns true if `f` returns true for any node in the tree. |
| 395 | /// |
no outgoing calls
no test coverage detected