pub struct ProjectCandidate {
pub name: String,
pub path: String,
pub owner: Option<String>,
pub registered: bool,
}Expand description
One candidate project row — everything the picker needs to render and bind it without a further round-trip.
Why: mirrors super::DirEntryInfo in spirit (name + path a client can
bind directly), but flatter — no is_dir (every entry here is already
known to be a directory) and no is_git_repo (every entry here is
already known to be a git repo — filtering, not badging, is this
endpoint’s job). owner carries the trusty-mpm-projects/<owner>/<repo>
layout’s owner segment when the scan found it that way, so the picker can
disambiguate two repos that share a name under different owners; None
on the home-directory fallback path, where there is no owner segment.
registered (issue #3435) distinguishes a project known to trusty-mpm’s
shared project registry from one this crate found only by scanning the
filesystem — a plain fs scan can never set it true on its own, so every
candidate this module produces starts false; only
super::mpm_registry::merge (the registry-primary merge step) flips it.
Test: tests::trusty_mpm_projects_layout_is_scanned_two_levels_deep.
Fields§
§name: StringThe repo directory’s own name (e.g. trusty-tools).
path: StringAbsolute path to the repo directory.
owner: Option<String>The owning directory’s name under ~/trusty-mpm-projects, when the
scan found this candidate that way; None on the home-directory
fallback path.
registered: boolWhether this candidate is also known to trusty-mpm’s shared project
registry (issue #3435). Always false from a bare filesystem scan —
see the struct docs.
Trait Implementations§
Source§impl Clone for ProjectCandidate
impl Clone for ProjectCandidate
Source§impl Debug for ProjectCandidate
impl Debug for ProjectCandidate
impl Eq for ProjectCandidate
Source§impl PartialEq for ProjectCandidate
impl PartialEq for ProjectCandidate
Source§impl Serialize for ProjectCandidate
impl Serialize for ProjectCandidate
impl StructuralPartialEq for ProjectCandidate
Auto Trait Implementations§
impl Freeze for ProjectCandidate
impl RefUnwindSafe for ProjectCandidate
impl Send for ProjectCandidate
impl Sync for ProjectCandidate
impl Unpin for ProjectCandidate
impl UnsafeUnpin for ProjectCandidate
impl UnwindSafe for ProjectCandidate
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.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more