ratatui-toolkit 0.2.6

DEPRECATED: this crate was renamed to `ratkit`. Please migrate to `ratkit`.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use anyhow::Result;
use std::path::PathBuf;

use crate::widgets::file_system_tree::{FileSystemTree, FileSystemTreeConfig};

impl<'a> FileSystemTree<'a> {
    pub fn with_config(root_path: PathBuf, config: FileSystemTreeConfig) -> Result<Self> {
        let nodes = Self::load_directory(&root_path, &config)?;

        Ok(Self {
            root_path,
            nodes,
            config,
            block: None,
        })
    }
}