Find the innermost frame that fully contains the given offset.
(&self, offset: u32)
| 210 | impl ScopeMap { |
| 211 | /// Find the innermost frame that fully contains the given offset. |
| 212 | pub(crate) fn enclosing_frame(&self, offset: u32) -> Option<&Frame> { |
| 213 | // Iterate in reverse so we find the innermost (most recently |
| 214 | // opened) frame first. Frames are sorted by start offset. |
| 215 | self.frames |
| 216 | .iter() |
| 217 | .rev() |
| 218 | .find(|f| offset >= f.start && offset <= f.end) |
| 219 | } |
| 220 | |
| 221 | /// Find the innermost frame that fully contains the given range. |
| 222 | pub(crate) fn enclosing_frame_for_range(&self, start: u32, end: u32) -> Option<&Frame> { |