ratatui_toolkit/widgets/markdown_widget/state/collapse_state/methods/get_hierarchy.rs
1//! Get hierarchy method for CollapseState.
2
3use crate::widgets::markdown_widget::state::CollapseState;
4
5impl CollapseState {
6 /// Get the hierarchy information for a section.
7 ///
8 /// # Arguments
9 ///
10 /// * `section_id` - The section ID to look up
11 ///
12 /// # Returns
13 ///
14 /// `Some((level, parent_id))` if the section exists, `None` otherwise.
15 pub fn get_hierarchy(&self, section_id: usize) -> Option<(u8, Option<usize>)> {
16 self.hierarchy.get(§ion_id).copied()
17 }
18}