pub struct RootScan {
pub root: PathBuf,
pub repos: Vec<PathBuf>,
pub skipped: Vec<PathBuf>,
}Expand description
What a shallow scan of one root found, including what it walked past.
discover_repos_under answers the membership question and is what building
a workspace uses. This answers the diagnostic one, because the shallow rule is
invisible at exactly the moment it matters: a root whose repos all live one
level deeper (~/GIT/<org>/<repo>, a common layout) yields a near-empty
workspace and no error, so the failure presents later as “the graph tools
return nothing useful” rather than as a configuration mistake (issue #580).
The rule itself is deliberate and is not what this changes — see
discover_repos_under.
Fields§
§root: PathBufThe root scanned.
repos: Vec<PathBuf>Repos found: the root itself if it is one, plus each immediate subdirectory that is one, sorted.
skipped: Vec<PathBuf>Immediate subdirectories that are not repos, sorted. A repo nested inside one of these is not hosted; counting them is free here because the scan already read the directory, which is why the successful-start note can report it without a second pass.
Implementations§
Source§impl RootScan
impl RootScan
Sourcepub fn nested_repo_parents(&self, limit: usize) -> Vec<&Path>
pub fn nested_repo_parents(&self, limit: usize) -> Vec<&Path>
Which skipped subdirectories hold a repo directly beneath them — the ones a user almost certainly meant to reach.
Costs one read_dir per skipped directory, so it is bounded by limit
and is for the path where the user is already stuck: a root that yielded
nothing to serve. A successful start reports RootScan::skipped instead,
which the scan already knows.
Trait Implementations§
impl Eq for RootScan
impl StructuralPartialEq for RootScan
Auto Trait Implementations§
impl Freeze for RootScan
impl RefUnwindSafe for RootScan
impl Send for RootScan
impl Sync for RootScan
impl Unpin for RootScan
impl UnsafeUnpin for RootScan
impl UnwindSafe for RootScan
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.