Skip to main content

from_path

Function from_path 

Source
pub fn from_path<P: AsRef<Path>>(path: P) -> Vec<BreadcrumbItem<'static>>
Expand description

Parses a filesystem Path into a vector of BreadcrumbItem segments.

Handles root directories (/ on Unix, drive letters on Windows), normal folder/file components, and special dot segments (., ..).

ยงExamples

use std::path::Path;
use tui_breadcrumb::from_path;

let path = Path::new("/var/log/nginx/access.log");
let items = from_path(path);
assert_eq!(items.len(), 5);