Function cargo_util::paths::ancestors

source ·
pub fn ancestors<'a>(
    path: &'a Path,
    stop_root_at: Option<&Path>
) -> PathAncestors<'a> 
Expand description

Returns an iterator that walks up the directory hierarchy towards the root.

Each item is a Path. It will start with the given path, finishing at the root. If the stop_root_at parameter is given, it will stop at the given path (which will be the last item).