Skip to main content

TreeSource

Trait TreeSource 

Source
pub trait TreeSource {
    // Required methods
    fn read(&self, path: &str) -> Option<Vec<u8>>;
    fn is_file(&self, path: &str) -> bool;
    fn is_dir(&self, path: &str) -> bool;
    fn children(&self, dir: &str) -> Vec<String>;
}
Expand description

Read access to a package tree through normalized package-relative paths.

Paths use / separators, are never absolute, and contain no empty, . or .. components. The empty path names the tree root for directory queries.

Required Methods§

Source

fn read(&self, path: &str) -> Option<Vec<u8>>

Source

fn is_file(&self, path: &str) -> bool

Source

fn is_dir(&self, path: &str) -> bool

Source

fn children(&self, dir: &str) -> Vec<String>

Return the direct child paths of dir in stable lexical order.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§