pub struct Mindmap {
pub path: PathBuf,
pub lines: Vec<String>,
pub nodes: Vec<Node>,
pub by_id: HashMap<u32, usize>,
}Fields§
§path: PathBuf§lines: Vec<String>§nodes: Vec<Node>§by_id: HashMap<u32, usize>Implementations§
Source§impl Mindmap
impl Mindmap
pub fn load(path: PathBuf) -> Result<Self>
Sourcepub fn load_from_reader<R: Read>(reader: R, path: PathBuf) -> Result<Self>
pub fn load_from_reader<R: Read>(reader: R, path: PathBuf) -> Result<Self>
Load mindmap content from any reader (e.g., stdin). Provide a path placeholder (e.g. “-”) so that callers can detect that the source was non-writable (stdin).
pub fn save(&mut self) -> Result<()>
pub fn next_id(&self) -> u32
pub fn get_node(&self, id: u32) -> Option<&Node>
Sourcepub fn normalize_spacing(&mut self) -> Result<()>
pub fn normalize_spacing(&mut self) -> Result<()>
Ensure there is at least one empty line between any two adjacent node lines. This inserts a blank line when two node lines are directly adjacent, and rebuilds internal node indices accordingly. The operation is idempotent.
Sourcepub fn apply_fixes(&mut self) -> Result<FixReport>
pub fn apply_fixes(&mut self) -> Result<FixReport>
Apply automatic fixes: normalize spacing (ensuring exactly one blank between nodes) and remove duplicated leading type prefixes in node titles (e.g., “AE: AE: Foo” -> “AE: Foo”).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Mindmap
impl RefUnwindSafe for Mindmap
impl Send for Mindmap
impl Sync for Mindmap
impl Unpin for Mindmap
impl UnwindSafe for Mindmap
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more