Activate the thread-local chain resolution cache. While the returned guard is alive, `resolve_target_classes` caches its results by subject text so that shared chain prefixes are resolved only once. Nested activations are no-ops — the outermost guard owns the cache.
()
| 91 | /// |
| 92 | /// Nested activations are no-ops — the outermost guard owns the cache. |
| 93 | pub(crate) fn with_chain_resolution_cache() -> ChainCacheGuard { |
| 94 | let already_active = CHAIN_CACHE.with(|cell| cell.borrow().is_some()); |
| 95 | if already_active { |
| 96 | return ChainCacheGuard { owns: false }; |
| 97 | } |
| 98 | CHAIN_CACHE.with(|cell| { |
| 99 | *cell.borrow_mut() = Some(HashMap::new()); |
| 100 | }); |
| 101 | ChainCacheGuard { owns: true } |
| 102 | } |
| 103 | |
| 104 | /// Type alias for the optional function-loader closure passed through |
| 105 | /// the resolution chain. Reduces clippy `type_complexity` warnings. |
no outgoing calls
no test coverage detected