Skip to main content

FilterTree

Trait FilterTree 

Source
pub trait FilterTree {
    // Required method
    fn filter_by_patterns<'a>(
        &'a self,
        tree: &'a Tree<'a>,
        patterns: &[&str],
    ) -> Result<Tree<'a>, Error>;
}

Required Methods§

Source

fn filter_by_patterns<'a>( &'a self, tree: &'a Tree<'a>, patterns: &[&str], ) -> Result<Tree<'a>, Error>

Filters tree entries by gitattributes-style patterns and returns a new tree with contents filtered through the provided patterns. Recursively walks the tree and matches patterns against full paths from the tree root.

The patterns type is an array of string slices and not a glob type because Git has specific glob syntax that differs from standard shell syntax.

Implementors§