Function cargo_util::paths::ancestors
source · [−]pub fn ancestors<'a>(
path: &'a Path,
stop_root_at: Option<&Path>
) -> PathAncestors<'a>ⓘNotable traits for PathAncestors<'a>impl<'a> Iterator for PathAncestors<'a> type Item = &'a Path;
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).